diff options
author | van Hauser <vh@thc.org> | 2020-05-13 16:39:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-13 16:39:23 +0200 |
commit | c4fe6f5277a8edfbf12d9c9c5db77ceb5271bd7f (patch) | |
tree | c039c7192a3aa9f83ac9f7dde9c68dac01f3f607 /src/afl-fuzz-run.c | |
parent | f8b3d34225102158ed585130e3de08772e989b53 (diff) | |
parent | 645e331559d01d234be231a7f5076c2ad658b159 (diff) | |
download | afl++-c4fe6f5277a8edfbf12d9c9c5db77ceb5271bd7f.tar.gz |
Merge pull request #361 from rish9101/pre_save_format
Add post library API as custom mutator and rename pre_save
Diffstat (limited to 'src/afl-fuzz-run.c')
-rw-r--r-- | src/afl-fuzz-run.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c index 468b5fc6..d9adb792 100644 --- a/src/afl-fuzz-run.c +++ b/src/afl-fuzz-run.c @@ -97,10 +97,10 @@ void write_to_testcase(afl_state_t *afl, void *mem, u32 len) { LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, { - if (el->afl_custom_pre_save) { + if (el->afl_custom_post_process) { new_size = - el->afl_custom_pre_save(el->data, new_mem, new_size, &new_buf); + el->afl_custom_post_process(el->data, new_mem, new_size, &new_buf); } @@ -110,7 +110,7 @@ void write_to_testcase(afl_state_t *afl, void *mem, u32 len) { if (unlikely(!new_buf && (new_size <= 0))) { - FATAL("Custom_pre_save failed (ret: %lu)", (long unsigned)new_size); + FATAL("Custom_post_process failed (ret: %lu)", (long unsigned)new_size); } else if (likely(new_buf)) { @@ -119,7 +119,7 @@ void write_to_testcase(afl_state_t *afl, void *mem, u32 len) { } else { - /* custom mutators do not has a custom_pre_save function */ + /* custom mutators do not has a custom_post_process function */ afl_fsrv_write_to_testcase(&afl->fsrv, mem, len); } @@ -690,18 +690,6 @@ u8 common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) { u8 fault; - if (afl->post_handler) { - - u8 *post_buf = NULL; - - size_t post_len = - afl->post_handler(afl->post_data, out_buf, len, &post_buf); - if (!post_buf || !post_len) { return 0; } - out_buf = post_buf; - len = post_len; - - } - write_to_testcase(afl, out_buf, len); fault = fuzz_run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout); |