1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00

Fix remotely exploitable buffer overflow (CVE-2002-0391).

This commit is contained in:
Stefan Eßer 2003-07-06 10:29:12 +00:00
parent d33a7a38e3
commit d9cc06b566
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=84290

24
games/acm/files/patch-09 Normal file
View File

@ -0,0 +1,24 @@
--- dis/lib/xdr_var_array.c~ Mon May 11 20:58:55 1998
+++ dis/lib/xdr_var_array.c Sun Jul 6 03:21:47 2003
@@ -75,6 +75,12 @@
#include <stdio.h>
#include <stdlib.h>
+#include <sys/param.h>
+#if __FreeBSD_Version__ >= 500113
+# include <sys/limits.h>
+#else
+# include <machine/limits.h>
+#endif
#include <rpc/types.h>
#include <rpc/xdr.h>
@@ -104,7 +110,7 @@
register u_int nodesize;
c = size;
- if ((c > maxsize) && (xdrs->x_op != XDR_FREE)) {
+ if ((c > maxsize || c > UINT_MAX/elsize) && (xdrs->x_op != XDR_FREE)) {
return (FALSE);
}
nodesize = c * elsize;