malloc_usable_size: Use correct size for dumped fake mapped chunks

The adjustment for the size computation in commit
1e8a8875d6 is needed in
malloc_usable_size, too.
This commit is contained in:
Florian Weimer 2016-06-11 12:09:19 +02:00
parent 983fd5c41a
commit 073f82140c
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2016-06-11 Florian Weimer <fweimer@redhat.com>
* malloc/malloc.c (musable): Return correct size for dumped fake
mmapped chunk.
2016-06-11 Florian Weimer <fweimer@redhat.com>
[BZ #20222]

View File

@ -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;
}