patches/glibc/2.1.3/rh62-10-glibc-2.1.3-xdr_array.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 --- glibc-2.1.3/sunrpc/rpc/types.h	Fri Oct 16 13:43:49 1998
     2 +++ glibc-2.1.3/sunrpc/rpc/types.h	Thu Aug  1 09:06:38 2002
     3 @@ -55,6 +55,10 @@
     4  
     5  #include <stdlib.h>		/* For malloc decl.  */
     6  #define mem_alloc(bsize)	malloc(bsize)
     7 +/*
     8 + * XXX: This must not use the second argument, or code in xdr_array.c needs
     9 + * to be modified.
    10 + */
    11  #define mem_free(ptr, bsize)	free(ptr)
    12  
    13  #ifndef makedev /* ie, we haven't already included it */
    14 --- glibc-2.1.3/sunrpc/xdr_array.c	Thu Jul 16 15:23:51 1998
    15 +++ glibc-2.1.3/sunrpc/xdr_array.c	Thu Aug  1 09:07:45 2002
    16 @@ -44,6 +44,7 @@
    17  #include <string.h>
    18  #include <rpc/types.h>
    19  #include <rpc/xdr.h>
    20 +#include <limits.h>
    21  
    22  #define LASTUNSIGNED	((u_int)0-1)
    23  
    24 @@ -76,7 +77,11 @@
    25        return FALSE;
    26      }
    27    c = *sizep;
    28 -  if ((c > maxsize) && (xdrs->x_op != XDR_FREE))
    29 +  /*
    30 +   * XXX: Let the overflow possibly happen with XDR_FREE because mem_free()
    31 +   * doesn't actually use its second argument anyway.
    32 +   */
    33 +  if ((c > maxsize || c > UINT_MAX / elsize) && (xdrs->x_op != XDR_FREE))
    34      {
    35        return FALSE;
    36      }