diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-09-07 16:06:54 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-09-07 16:06:54 +0000 |
commit | 469615bdd422cec2d89a09c765a8e965faa29722 (patch) | |
tree | fa9d9c80c22d4a88d0c0d94e1e9c2cbb982c494c /malloc/arena.c | |
parent | ba40cc1540f5ee1e2082bd31b0e602a62ea3273f (diff) | |
download | glibc-469615bdd422cec2d89a09c765a8e965faa29722.tar.gz glibc-469615bdd422cec2d89a09c765a8e965faa29722.tar.xz glibc-469615bdd422cec2d89a09c765a8e965faa29722.zip |
[BZ #2775]
* malloc/malloc.c (sYSMALLOc): Only call grow_heap if (long) (MINSIZE + nb - old_size) is positive. * malloc/arena.c (grow_heap): When growing bail even if new_size is negative.
Diffstat (limited to 'malloc/arena.c')
-rw-r--r-- | malloc/arena.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/malloc/arena.c b/malloc/arena.c index 6f4b0c497b..2179174d64 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -712,7 +712,7 @@ grow_heap(h, diff) heap_info *h; long diff; if(diff >= 0) { diff = (diff + page_mask) & ~page_mask; new_size = (long)h->size + diff; - if(new_size > HEAP_MAX_SIZE) + if((unsigned long) new_size > (unsigned long) HEAP_MAX_SIZE) return -1; if(mprotect((char *)h + h->size, diff, PROT_READ|PROT_WRITE) != 0) return -2; |