aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--malloc/malloc.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4028db2..2989d21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
}