mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
malloc: Ensure that the consolidated fast chunk has a sane size.
This commit is contained in:
committed by
Florian Weimer
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>
|
2018-01-12 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
* support/write_message.c (write_message): Preserve errno.
|
* support/write_message.c (write_message): Preserve errno.
|
||||||
|
@@ -4431,6 +4431,12 @@ static void malloc_consolidate(mstate av)
|
|||||||
p = atomic_exchange_acq (fb, NULL);
|
p = atomic_exchange_acq (fb, NULL);
|
||||||
if (p != 0) {
|
if (p != 0) {
|
||||||
do {
|
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);
|
check_inuse_chunk(av, p);
|
||||||
nextp = p->fd;
|
nextp = p->fd;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user