From patchwork Fri Oct 28 13:04:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 16908 Received: (qmail 112342 invoked by alias); 28 Oct 2016 13:04:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 112306 invoked by uid 89); 28 Oct 2016 13:04:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Date: Fri, 28 Oct 2016 15:04:49 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] sysmalloc: Initialize previous size field of mmaped chunks User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20161028130449.BB0E9439942E0@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) With different encodings of the header, the previous zero initialization may be insufficient and produce an invalid encoding. 2016-10-27 Florian Weimer * 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); }