From: Florian Weimer Date: Sat, 11 Jun 2016 10:09:19 +0000 (+0200) Subject: malloc_usable_size: Use correct size for dumped fake mapped chunks X-Git-Tag: glibc-2.24~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=073f82140c7dbd7af387153c29ac7ac3e882c4ef;p=thirdparty%2Fglibc.git malloc_usable_size: Use correct size for dumped fake mapped chunks The adjustment for the size computation in commit 1e8a8875d69e36d2890b223ffe8853a8ff0c9512 is needed in malloc_usable_size, too. --- diff --git a/ChangeLog b/ChangeLog index 4028db2fd9c..2989d219404 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-06-11 Florian Weimer + + * malloc/malloc.c (musable): Return correct size for dumped fake + mmapped chunk. + 2016-06-11 Florian Weimer [BZ #20222] diff --git a/malloc/malloc.c b/malloc/malloc.c index ac0f7515939..21a912a6d1e 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4622,7 +4622,12 @@ musable (void *mem) return malloc_check_get_size (p); if (chunk_is_mmapped (p)) - return chunksize (p) - 2 * SIZE_SZ; + { + if (DUMPED_MAIN_ARENA_CHUNK (p)) + return chunksize (p) - SIZE_SZ; + else + return chunksize (p) - 2 * SIZE_SZ; + } else if (inuse (p)) return chunksize (p) - SIZE_SZ; }