summaryrefslogtreecommitdiffstats
path: root/lib/libc/xdr/xdr_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/xdr/xdr_array.c')
-rw-r--r--lib/libc/xdr/xdr_array.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/xdr/xdr_array.c b/lib/libc/xdr/xdr_array.c
index d75c53f..5673014 100644
--- a/lib/libc/xdr/xdr_array.c
+++ b/lib/libc/xdr/xdr_array.c
@@ -78,11 +78,12 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
u_int nodesize;
/* like strings, arrays are really counted arrays */
- if (! xdr_u_int(xdrs, sizep)) {
+ if (!xdr_u_int(xdrs, sizep)) {
return (FALSE);
}
c = *sizep;
- if ((c > maxsize) && (xdrs->x_op != XDR_FREE)) {
+ if ((c > maxsize && UINT_MAX/elsize < c) &&
+ (xdrs->x_op != XDR_FREE)) {
return (FALSE);
}
nodesize = c * elsize;
@@ -152,7 +153,7 @@ xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
elptr = basep;
for (i = 0; i < nelem; i++) {
- if (! (*xdr_elem)(xdrs, elptr)) {
+ if (!(*xdr_elem)(xdrs, elptr)) {
return(FALSE);
}
elptr += elemsize;
OpenPOWER on IntegriCloud