From 681421f3cac665a82d000d854ae6df1fb3b561a5 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 27 Oct 2016 19:45:19 +0200 Subject: sysmalloc: Initialize previous size field of mmaped chunks With different encodings of the header, the previous zero initialization may be insufficient and produce an invalid encoding. --- malloc/malloc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'malloc') diff --git a/malloc/malloc.c b/malloc/malloc.c index f3378b9..a10477e 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -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); } -- cgit v1.1