diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-07-07 14:29:02 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-07-07 14:29:02 +0000 |
commit | 597d10a00a66955a0f3998e265eaa2d100d5b876 (patch) | |
tree | 9840994a1f95f33ab327f4cb14b72650ce0ef160 /malloc/malloc.c | |
parent | 1823e76b95f8d188de1658eaf77e71e20508bcc8 (diff) | |
download | glibc-597d10a00a66955a0f3998e265eaa2d100d5b876.tar glibc-597d10a00a66955a0f3998e265eaa2d100d5b876.tar.gz glibc-597d10a00a66955a0f3998e265eaa2d100d5b876.tar.bz2 glibc-597d10a00a66955a0f3998e265eaa2d100d5b876.zip |
Update.
* malloc/malloc.c (request2size): Take care of overflow in
addition.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r-- | malloc/malloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index e096f00eeb..09085e81ad 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1263,8 +1263,9 @@ static void free_atfork(); #define request2size(req, nb) \ ((nb = (req) + (SIZE_SZ + MALLOC_ALIGN_MASK)),\ - ((long)nb <= 0 ? 1 : ((nb < (MINSIZE + MALLOC_ALIGN_MASK) ? (nb = MINSIZE) :\ - (nb &= ~MALLOC_ALIGN_MASK)), 0))) + ((long)nb <= 0 || nb < (INTERNAL_SIZE_T) (req) \ + ? 1 : ((nb < (MINSIZE + MALLOC_ALIGN_MASK) \ + ? (nb = MINSIZE) : (nb &= ~MALLOC_ALIGN_MASK)), 0))) /* Check if m has acceptable alignment */ |