From 8705bd3009a6a7ee96f4dc629243d491a1087a77 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Sat, 3 Aug 2002 21:33:30 +0000 Subject: [PATCH] This commit was generated by cvs2svn to compensate for changes in r519, which included commits to RCS files with non-trunk default branches. --- src/rx/xdr.c | 16 ++++++++++++---- src/rx/xdr_array.c | 16 +++++++++++----- src/rx/xdr_arrayn.c | 16 +++++++++++----- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/rx/xdr.c b/src/rx/xdr.c index 44d6421d6..8775d4e05 100644 --- a/src/rx/xdr.c +++ b/src/rx/xdr.c @@ -26,11 +26,16 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ -#ifndef NeXT -#ifndef lint -static char sccsid[] = "@(#)xdr.c 1.1 86/02/03 Copyr 1984 Sun Micro"; + +#include +#ifdef KERNEL +#include "../afs/param.h" +#else +#include #endif +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr.c,v 1.1.1.3.2.1 2002/08/03 21:33:30 hartmans Exp $"); + /* * xdr.c, Generic XDR routines implementation. * @@ -41,8 +46,9 @@ static char sccsid[] = "@(#)xdr.c 1.1 86/02/03 Copyr 1984 Sun Micro"; * xdr. */ +#ifndef NeXT + #ifdef KERNEL -#include "../afs/param.h" #include #ifndef AFS_LINUX20_ENV #include @@ -550,6 +556,8 @@ xdr_string(xdrs, cpp, maxsize) u_int size; u_int nodesize; + if (maxsize > ((~0) >> 1) - 1) maxsize = ((~0) >> 1) - 1; + /* * first deal with the length since xdr strings are counted-strings */ diff --git a/src/rx/xdr_array.c b/src/rx/xdr_array.c index 2d5bb9efc..38f17307d 100644 --- a/src/rx/xdr_array.c +++ b/src/rx/xdr_array.c @@ -26,11 +26,12 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ +#include #include + +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_array.c,v 1.1.1.4.2.1 2002/08/03 21:33:30 hartmans Exp $"); + #ifndef NeXT -#ifndef lint -static char sccsid[] = "@(#)xdr_array.c 1.1 86/02/03 Copyr 1984 Sun Micro"; -#endif /* * xdr_array.c, Generic XDR routines impelmentation. @@ -45,7 +46,9 @@ static char sccsid[] = "@(#)xdr_array.c 1.1 86/02/03 Copyr 1984 Sun Micro"; #include #ifdef AFS_LINUX20_ENV #include "../h/string.h" +#if 0 #define bzero(A,C) memset((A), 0, (C)) +#endif #else #include #endif /* AFS_LINUX20_ENV */ @@ -81,7 +84,10 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) register caddr_t target = *addrp; register u_int c; /* the actual element count */ register bool_t stat = TRUE; - register int nodesize; + register u_int nodesize; + + i = ((~0) >> 1) / elsize; + if (maxsize > i) maxsize = i; /* like strings, arrays are really counted arrays */ if (! xdr_u_int(xdrs, sizep)) { @@ -106,7 +112,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) if (target == NULL) { return (FALSE); } - bzero(target, (u_int)nodesize); + memset(target, 0, (u_int)nodesize); break; case XDR_FREE: diff --git a/src/rx/xdr_arrayn.c b/src/rx/xdr_arrayn.c index a9c17510b..1c38d49fe 100644 --- a/src/rx/xdr_arrayn.c +++ b/src/rx/xdr_arrayn.c @@ -26,11 +26,12 @@ * 2550 Garcia Avenue * Mountain View, California 94043 */ +#include #include + +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_arrayn.c,v 1.1.1.4.2.1 2002/08/03 21:33:30 hartmans Exp $"); + #if !defined(NeXT) -#ifndef lint -static char sccsid[] = "@(#)xdr_array.c 1.1 86/02/03 Copyr 1984 Sun Micro"; -#endif /* * xdr_array.c, Generic XDR routines impelmentation. @@ -45,7 +46,9 @@ static char sccsid[] = "@(#)xdr_array.c 1.1 86/02/03 Copyr 1984 Sun Micro"; #include #ifdef AFS_LINUX20_ENV #include "../h/string.h" +#if 0 #define bzero(A,C) memset((A), 0, (C)) +#endif #else #include #endif @@ -86,7 +89,10 @@ bool_t xdr_arrayN(xdrs, addrp, sizep, maxsize, elsize, elproc) register caddr_t target = *addrp; register u_int c; /* the actual element count */ register bool_t stat = TRUE; - register int nodesize; + register u_int nodesize; + + i = ((~0) >> 1) / elsize; + if (maxsize > i) maxsize = i; /* like strings, arrays are really counted arrays */ if (! xdr_u_int(xdrs, sizep)) { @@ -111,7 +117,7 @@ bool_t xdr_arrayN(xdrs, addrp, sizep, maxsize, elsize, elproc) if (target == NULL) { return (FALSE); } - bzero(target, (u_int)nodesize); + memset(target, 0, (u_int)nodesize); break; case XDR_FREE: -- 2.39.5