]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc_usable_size: Use correct size for dumped fake mapped chunks
authorFlorian Weimer <fweimer@redhat.com>
Sat, 11 Jun 2016 10:09:19 +0000 (12:09 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Sat, 11 Jun 2016 10:09:19 +0000 (12:09 +0200)
The adjustment for the size computation in commit
1e8a8875d69e36d2890b223ffe8853a8ff0c9512 is needed in
malloc_usable_size, too.

ChangeLog
malloc/malloc.c

index 4028db2fd9c4127069a1b830dba2cf7ae6d42959..2989d219404e8e6d57a79e1b75dd9172eda0a4b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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]
index ac0f75159398d0d16e2d1c7effbc65f77e9fe5ab..21a912a6d1e23a7caba3ea258fb86cf23a383b13 100644 (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;
     }