diff options
author | Alexander Shvedov <60114847+a-shvedov@users.noreply.github.com> | 2023-05-22 16:57:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 16:57:45 +0300 |
commit | 629edb1e78d791894ce9ee6d53259f95fe1a29af (patch) | |
tree | 3337fbdabebc223c5222b650127af7469a77f693 /include/alloc-inl.h | |
parent | 8012b555a8cbc49f1c78d4a33cad56ea59280780 (diff) | |
parent | c4b1566ba35c697cda7822bd0cf30e2e3eeee0c7 (diff) | |
download | afl++-629edb1e78d791894ce9ee6d53259f95fe1a29af.tar.gz |
Merge pull request #2 from AFLplusplus/stable
push to stable (#1734)
Diffstat (limited to 'include/alloc-inl.h')
-rw-r--r-- | include/alloc-inl.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/alloc-inl.h b/include/alloc-inl.h index ae37028e..1e9a192b 100644 --- a/include/alloc-inl.h +++ b/include/alloc-inl.h @@ -42,7 +42,7 @@ // Be careful! _WANT_ORIGINAL_AFL_ALLOC is not compatible with custom mutators #ifndef _WANT_ORIGINAL_AFL_ALLOC - // afl++ stuff without memory corruption checks - for speed + // AFL++ stuff without memory corruption checks - for speed /* User-facing macro to sprintf() to a dynamically allocated buffer. */ @@ -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; |