From 4cd4c5d6a28c4fbdc86651c4578f4c4f24efce08 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 17 Dec 2007 18:44:04 +0000 Subject: * malloc/malloc.c (public_cALLOc): For arena other than main_arena, count all bytes inside the mprotect_size range of the heap as uninitialized. --- malloc/malloc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'malloc/malloc.c') diff --git a/malloc/malloc.c b/malloc/malloc.c index c54c203cbf..fc8a83c328 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -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); -- cgit 1.4.1