aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-03-12 15:57:17 -0700
committerDavid S. Miller <davem@davemloft.net>2012-03-12 15:57:17 -0700
commit98bb2f1cd2b6eb794ecaf5ce4fcc3c79ee4df3e5 (patch)
treeaf5dadcad9baae2815c4a6f09a0ac2d826b658e4 /sysdeps/generic
parentb4b2eb5eae714b97d6a4315846e5fec72096806c (diff)
downloadglibc-98bb2f1cd2b6eb794ecaf5ce4fcc3c79ee4df3e5.zip
glibc-98bb2f1cd2b6eb794ecaf5ce4fcc3c79ee4df3e5.tar.gz
glibc-98bb2f1cd2b6eb794ecaf5ce4fcc3c79ee4df3e5.tar.bz2
Fix another instance of the _dl_random masking bug, plus coding style.
* sysdeps/generic/dl-osinfo.h (_dl_setup_stack_chk_guard): Fix masking out of the most significant byte of random value used. * sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard): Fix coding style in previous change.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/dl-osinfo.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/generic/dl-osinfo.h b/sysdeps/generic/dl-osinfo.h
index 548fc46..983cd55 100644
--- a/sysdeps/generic/dl-osinfo.h
+++ b/sysdeps/generic/dl-osinfo.h
@@ -37,9 +37,9 @@ _dl_setup_stack_chk_guard (void *dl_random)
{
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