Last active
July 6, 2021 10:41
-
-
Save saidelike/7717589b053a63a51e91aebb4d7c8393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//glibc_2.17-322.el7_9/malloc/malloc.c | |
static void* | |
_int_malloc(mstate av, size_t bytes) | |
{ | |
... | |
for(;;) { | |
int iters = 0; | |
while ( (victim = unsorted_chunks(av)->bk) != unsorted_chunks(av)) { | |
bck = victim->bk; | |
if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0) | |
|| __builtin_expect (victim->size > av->system_mem, 0)) | |
{ | |
mutex_unlock(&av->mutex); | |
malloc_printerr (check_action, "malloc(): memory corruption", | |
[c1] chunk2mem (victim), av); | |
mutex_lock(&av->mutex); | |
} | |
size = chunksize(victim); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment