fix reallocs

This commit is contained in:
vanhauser-thc
2023-05-01 15:07:49 +02:00
parent 2cd07abca9
commit 22db79aefa
2 changed files with 42 additions and 4 deletions

View File

@ -704,12 +704,11 @@ static inline void *afl_realloc(void **buf, size_t size_needed) {
*buf = NULL;
return NULL;
} else {
new_buf = newer_buf;
}
new_buf = newer_buf;
memset(((u8 *)new_buf) + current_size, 0, next_size - current_size);
new_buf->complete_size = next_size;
*buf = (void *)(new_buf->buf);
return *buf;