update xdr so internal variables match what's being passed in
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
*/
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)) {
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)) {