diff options
author | van Hauser <vh@thc.org> | 2020-12-15 09:39:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 09:39:10 +0100 |
commit | 8e712d1a740b30f9e2d5655d97d4cac6e8aed543 (patch) | |
tree | 912ea1a05ba03709563b9ebea43957cd9a463fbf /src/afl-fuzz-run.c | |
parent | 12d62d539353517abee8069df6e591f4fc474e93 (diff) | |
parent | 149ec41e9039d79420088c6de7bfc7feba5fe937 (diff) | |
download | afl++-8e712d1a740b30f9e2d5655d97d4cac6e8aed543.tar.gz |
Merge pull request #628 from AFLplusplus/dev 3.0c
Final push to stable
Diffstat (limited to 'src/afl-fuzz-run.c')
-rw-r--r-- | src/afl-fuzz-run.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c index 5948d83a..a97ceb89 100644 --- a/src/afl-fuzz-run.c +++ b/src/afl-fuzz-run.c @@ -94,9 +94,9 @@ write_to_testcase(afl_state_t *afl, void *mem, u32 len) { if (unlikely(afl->custom_mutators_count)) { - u8 * new_buf = NULL; ssize_t new_size = len; - void * new_mem = mem; + u8 * new_mem = mem; + u8 * new_buf = NULL; LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, { @@ -152,13 +152,13 @@ static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at, if (unlikely(!mem_trimmed)) { PFATAL("alloc"); } ssize_t new_size = len - skip_len; - void * new_mem = mem; - u8 * new_buf = NULL; + u8 * new_mem = mem; bool post_process_skipped = true; if (unlikely(afl->custom_mutators_count)) { + u8 *new_buf = NULL; new_mem = mem_trimmed; LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, { @@ -205,9 +205,9 @@ static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at, if (!post_process_skipped) { - // If we did post_processing, copy directly from the new_buf bufer + // If we did post_processing, copy directly from the new_mem buffer - memcpy(afl->fsrv.shmem_fuzz, new_buf, new_size); + memcpy(afl->fsrv.shmem_fuzz, new_mem, new_size); } @@ -265,7 +265,7 @@ static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at, if (!post_process_skipped) { - ck_write(fd, new_buf, new_size, afl->fsrv.out_file); + ck_write(fd, new_mem, new_size, afl->fsrv.out_file); } else { |