1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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.
This commit is contained in:
Florian Weimer
2016-10-27 19:45:19 +02:00
parent e9c4fe93b3
commit 681421f3ca
2 changed files with 6 additions and 0 deletions

View 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);
}