From: David S. Miller Date: Mon, 12 Mar 2012 02:41:43 +0000 (-0700) Subject: Fix typing of the bit twiddling done in _dl_setup_stack_chk_guard. X-Git-Tag: glibc-2.16-tps~825 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb9d617437084b4ebf02e50c0a82c5dd2582029a;p=thirdparty%2Fglibc.git Fix typing of the bit twiddling done in _dl_setup_stack_chk_guard. * sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard): Fix masking out of the most significant byte of random value used. --- diff --git a/ChangeLog b/ChangeLog index 85993dce6ba..29b7c67e9e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2012-03-11 David S. Miller + * sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard): + Fix masking out of the most significant byte of random value used. + * sysdeps/sparc/fpu/libm-test-ulps: Update. 2012-03-10 Andreas Schwab diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h index 780b20ab6a9..1ff8a2f6a28 100644 --- a/sysdeps/unix/sysv/linux/dl-osinfo.h +++ b/sysdeps/unix/sysv/linux/dl-osinfo.h @@ -95,9 +95,9 @@ _dl_setup_stack_chk_guard (void *dl_random) directly and not use the kernel-provided data to seed a PRNG. */ memcpy (ret.bytes, dl_random, sizeof (ret)); #if BYTE_ORDER == LITTLE_ENDIAN - ret.num &= ~0xff; + ret.num &= ~(uintptr_t)0xff; #elif BYTE_ORDER == BIG_ENDIAN - ret.num &= ~(0xff << (8 * (sizeof (ret) - 1))); + ret.num &= ~((uintptr_t)0xff << (8 * (sizeof (ret) - 1))); #else # error "BYTE_ORDER unknown" #endif