malloc: Ensure that the consolidated fast chunk has a sane size.
This commit is contained in:
parent
1a51e46e4a
commit
249a5895f1
|
@ -1,3 +1,7 @@
|
|||
2018-01-12 Istvan Kurucsai <pistukem@gmail.com>
|
||||
|
||||
* malloc/malloc.c (malloc_consolidate): Add size check.
|
||||
|
||||
2018-01-12 Florian Weimer <fweimer@redhat.com>
|
||||
|
||||
* support/write_message.c (write_message): Preserve errno.
|
||||
|
|
|
@ -4431,6 +4431,12 @@ static void malloc_consolidate(mstate av)
|
|||
p = atomic_exchange_acq (fb, NULL);
|
||||
if (p != 0) {
|
||||
do {
|
||||
{
|
||||
unsigned int idx = fastbin_index (chunksize (p));
|
||||
if ((&fastbin (av, idx)) != fb)
|
||||
malloc_printerr ("malloc_consolidate(): invalid chunk size");
|
||||
}
|
||||
|
||||
check_inuse_chunk(av, p);
|
||||
nextp = p->fd;
|
||||
|
||||
|
|
Loading…
Reference in New Issue