]> sourceware.org Git - glibc.git/commitdiff
sysmalloc: Initialize previous size field of mmaped chunks
authorFlorian Weimer <fweimer@redhat.com>
Thu, 27 Oct 2016 17:45:19 +0000 (19:45 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 28 Oct 2016 14:49:04 +0000 (16:49 +0200)
With different encodings of the header, the previous zero initialization
may be insufficient and produce an invalid encoding.

ChangeLog
malloc/malloc.c

index e071097f5d456150830f35aa68c97dc3caeb66bb..997431eea9ce69d4bd13929af3b0783a99a7d719 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-27  Florian Weimer  <fweimer@redhat.com>
+
+       * malloc/malloc.c (sysmalloc): Initialize previous size field of
+       mmaped chunks.
+
 2016-10-28  Florian Weimer  <fweimer@redhat.com>
 
        * malloc/malloc.c (struct malloc_chunk): Rename prev_size, size
index f3378b90ed4dfa9c93a551fa55b8cd5502c3e57d..a10477ed4cb155a027d6d3d45b9bbd29c5ef4b19 100644 (file)
@@ -2306,6 +2306,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
               else
                 {
                   p = (mchunkptr) mm;
+                 set_prev_size (p, 0);
                   set_head (p, size | IS_MMAPPED);
                 }
 
This page took 0.153864 seconds and 5 git commands to generate.