(grow_heap): When growing bail even if new_size is negative.
authordrepper <drepper>
Thu, 7 Sep 2006 16:04:22 +0000 (16:04 +0000)
committerdrepper <drepper>
Thu, 7 Sep 2006 16:04:22 +0000 (16:04 +0000)
malloc/arena.c

index 6f4b0c4..2179174 100644 (file)
@@ -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;