public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sysmalloc: Initialize previous size field of mmaped chunks
@ 2016-10-28 13:04 Florian Weimer
  2016-10-28 14:13 ` Carlos O'Donell
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2016-10-28 13:04 UTC (permalink / raw)
  To: libc-alpha

With different encodings of the header, the previous zero initialization
may be insufficient and produce an invalid encoding.

2016-10-27  Florian Weimer  <fweimer@redhat.com>

	* malloc/malloc.c (sysmalloc): Initialize previous size field of
	mmaped chunks.

diff --git a/malloc/malloc.c b/malloc/malloc.c
index 186e174..72d22bd 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);
                 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-28 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 13:04 [PATCH] sysmalloc: Initialize previous size field of mmaped chunks Florian Weimer
2016-10-28 14:13 ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).