Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/games/acm/files/patch-dis_lib_xdr_var_array.c
16151 views
1
--- dis/lib/xdr_var_array.c.orig 1998-05-12 03:58:55 UTC
2
+++ dis/lib/xdr_var_array.c
3
@@ -75,6 +75,7 @@ static char *rcsid = "$Id: xdr_var_array.c,v 1.2 1998/
4
5
#include <stdio.h>
6
#include <stdlib.h>
7
+#include <limits.h>
8
#include <rpc/types.h>
9
#include <rpc/xdr.h>
10
11
@@ -104,7 +105,7 @@ xdr_var_array(register XDR * xdrs, caddr_t * addrp, u_
12
register u_int nodesize;
13
14
c = size;
15
- if ((c > maxsize) && (xdrs->x_op != XDR_FREE)) {
16
+ if ((c > maxsize || c > UINT_MAX/elsize) && (xdrs->x_op != XDR_FREE)) {
17
return (FALSE);
18
}
19
nodesize = c * elsize;
20
21