diff options
author | Florian Weimer <fweimer@redhat.com> | 2016-06-11 12:09:19 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2016-06-11 12:09:19 +0200 |
commit | 073f82140c7dbd7af387153c29ac7ac3e882c4ef (patch) | |
tree | 9fbb2c23eccc4fd63e44da46fa389c2e4bf50e50 | |
parent | 983fd5c41ab7e5a5c33922259ca1ac99b3b413f8 (diff) | |
download | glibc-073f82140c7dbd7af387153c29ac7ac3e882c4ef.zip glibc-073f82140c7dbd7af387153c29ac7ac3e882c4ef.tar.gz glibc-073f82140c7dbd7af387153c29ac7ac3e882c4ef.tar.bz2 |
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.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | malloc/malloc.c | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -1,5 +1,10 @@ 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] * libio/iofopncook.c (_IO_cookie_read): Demangle callback pointer. (_IO_cookie_write): Likewise. diff --git a/malloc/malloc.c b/malloc/malloc.c index ac0f751..21a912a 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; } |