]> sourceware.org Git - glibc.git/commitdiff
* malloc/malloc.c (public_cALLOc): For arena other than
authorUlrich Drepper <drepper@redhat.com>
Mon, 17 Dec 2007 18:44:04 +0000 (18:44 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 17 Dec 2007 18:44:04 +0000 (18:44 +0000)
main_arena, count all bytes inside the mprotect_size range of the
heap as uninitialized.

ChangeLog
malloc/malloc.c

index c728e04016b27af162150ec5affe1ce8c16c34b0..4c2385198166792e8aad12d87d31c6fc9f963d2a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-17  Ulrich Drepper  <drepper@redhat.com>
+
+       * malloc/malloc.c (public_cALLOc): For arena other than
+       main_arena, count all bytes inside the mprotect_size range of the
+       heap as uninitialized.
+
 2007-12-16  Ulrich Drepper  <drepper@redhat.com>
 
        * elf/tst-execstack.c (do_test): Don't fail if SELinux forbids
index c54c203cbf1f024e72493546221305b4fd5729b7..fc8a83c3286649b7f13b0db4d63e69b50ccfaa1d 100644 (file)
@@ -3886,6 +3886,12 @@ public_cALLOc(size_t n, size_t elem_size)
       oldtopsize < mp_.sbrk_base + av->max_system_mem - (char *)oldtop)
     oldtopsize = (mp_.sbrk_base + av->max_system_mem - (char *)oldtop);
 #endif
+  if (av != &main_arena)
+    {
+      heap_info *heap = heap_for_ptr (oldtop);
+      if (oldtopsize < (char *) heap + heap->mprotect_size - (char *) oldtop)
+       oldtopsize = (char *) heap + heap->mprotect_size - (char *) oldtop;
+    }
 #endif
   mem = _int_malloc(av, sz);
 
This page took 0.056936 seconds and 5 git commands to generate.