diff options
| author | vanhauser-thc <vh@thc.org> | 2023-05-01 15:07:49 +0200 |
|---|---|---|
| committer | vanhauser-thc <vh@thc.org> | 2023-05-01 15:07:57 +0200 |
| commit | 22db79aefafb48fed48199a86a39babdee795870 (patch) | |
| tree | 716d5b3ac8cb800358015f8a0eff30fc55e10eb2 /include/alloc-inl.h | |
| parent | 2cd07abca9c7b843bbd2085e0e4d852d41169092 (diff) | |
| download | afl++-22db79aefafb48fed48199a86a39babdee795870.tar.gz | |
fix reallocs
Diffstat (limited to 'include/alloc-inl.h')
| -rw-r--r-- | include/alloc-inl.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/alloc-inl.h b/include/alloc-inl.h index bbb42e88..1e9a192b 100644 --- a/include/alloc-inl.h +++ b/include/alloc-inl.h @@ -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; |
