xdr-updates-20020731

update xdr so internal variables match what's being passed in
This commit is contained in:
Jeffrey Hutzelman 2002-08-01 00:13:09 +00:00 committed by Derrick Brashear
parent aea332588b
commit 2d6ebd0cda
3 changed files with 10 additions and 2 deletions

View File

@ -558,6 +558,8 @@ xdr_string(xdrs, cpp, maxsize)
u_int size; u_int size;
u_int nodesize; u_int nodesize;
if (maxsize > ((~0) >> 1) - 1) maxsize = ((~0) >> 1) - 1;
/* /*
* first deal with the length since xdr strings are counted-strings * first deal with the length since xdr strings are counted-strings
*/ */

View File

@ -84,7 +84,10 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
register caddr_t target = *addrp; register caddr_t target = *addrp;
register u_int c; /* the actual element count */ register u_int c; /* the actual element count */
register bool_t stat = TRUE; 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 */ /* like strings, arrays are really counted arrays */
if (! xdr_u_int(xdrs, sizep)) { if (! xdr_u_int(xdrs, sizep)) {

View File

@ -89,7 +89,10 @@ bool_t xdr_arrayN(xdrs, addrp, sizep, maxsize, elsize, elproc)
register caddr_t target = *addrp; register caddr_t target = *addrp;
register u_int c; /* the actual element count */ register u_int c; /* the actual element count */
register bool_t stat = TRUE; 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 */ /* like strings, arrays are really counted arrays */
if (! xdr_u_int(xdrs, sizep)) { if (! xdr_u_int(xdrs, sizep)) {