I'm very pleased to announce the release of our new website and documentation using the new toolchain with Hugo and AsciiDoctor. To get more information about the new toolchain please read the FreeBSD Documentation Project Primer[1], Hugo docs[2] and AsciiDoctor docs[3]. Acknowledgment: Benedict Reuschling <bcr@> Glen Barber <gjb@> Hiroki Sato <hrs@> Li-Wen Hsu <lwhsu@> Sean Chittenden <seanc@> The FreeBSD Foundation [1] https://docs.FreeBSD.org/en/books/fdp-primer/ [2] https://gohugo.io/documentation/ [3] https://docs.asciidoctor.org/home/ Approved by: doceng, core
34 lines
887 B
Diff
34 lines
887 B
Diff
--- lib/libc/xdr/xdr_array.c:1.8 Fri Aug 27 19:02:55 1999
|
|
+++ lib/libc/xdr/xdr_array.c Wed Jul 31 10:11:59 2002
|
|
@@ -42,6 +42,7 @@
|
|
* arrays. See xdr.h for more info on the interface to xdr.
|
|
*/
|
|
|
|
+#include <limits.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
@@ -73,11 +74,12 @@
|
|
register 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;
|
|
@@ -145,7 +147,7 @@
|
|
|
|
elptr = basep;
|
|
for (i = 0; i < nelem; i++) {
|
|
- if (! (*xdr_elem)(xdrs, elptr, LASTUNSIGNED)) {
|
|
+ if (!(*xdr_elem)(xdrs, elptr, LASTUNSIGNED)) {
|
|
return(FALSE);
|
|
}
|
|
elptr += elemsize;
|