From: Jeffrey Hutzelman Date: Thu, 1 Aug 2002 00:13:09 +0000 (+0000) Subject: xdr-updates-20020731 X-Git-Tag: openafs-devel_1_3_3~32 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=2d6ebd0cda81cff70a22a4393aaf58c5b7ccbb2e xdr-updates-20020731 update xdr so internal variables match what's being passed in --- diff --git a/src/rx/xdr.c b/src/rx/xdr.c index 8ca8a4a..c1d07c0 100644 --- a/src/rx/xdr.c +++ b/src/rx/xdr.c @@ -558,6 +558,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 ea5de24..d495610 100644 --- a/src/rx/xdr_array.c +++ b/src/rx/xdr_array.c @@ -84,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)) { diff --git a/src/rx/xdr_arrayn.c b/src/rx/xdr_arrayn.c index e89322a..70cb23f 100644 --- a/src/rx/xdr_arrayn.c +++ b/src/rx/xdr_arrayn.c @@ -89,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)) {