patches/glibc/2.1.3/rh62-10-glibc-2.1.3-xdr_array.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
     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      }