about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--docs/Changelog.md1
-rw-r--r--src/afl-fuzz-run.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 1e2a4765..f7842d59 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -13,6 +13,7 @@
     - added scale support to CMPLOG (-l S)
     - added --version and --help command line parameters
     - fixed endless loop when reading malformed dictionaries
+    - new custom mutator function: post_run - thanks to yangzao!
   - afl-whatsup:
     - detect instanced that are starting up and show them as such as not dead
     - now also shows coverage reached
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index b6d5df95..34a5ff81 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -62,12 +62,16 @@ fuzz_run_target(afl_state_t *afl, afl_forkserver_t *fsrv, u32 timeout) {
 
   /* If post_run() function is defined in custom mutator, the function will be
      called each time after AFL++ executes the target program. */
-  
+
   if (unlikely(afl->custom_mutators_count)) {
 
     LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, {
 
-      if (el->afl_custom_post_run) { el->afl_custom_post_run(el->data); }
+      if (unlikely(el->afl_custom_post_run)) {
+
+        el->afl_custom_post_run(el->data);
+
+      }
 
     });
 
@@ -1123,3 +1127,4 @@ common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
   return 0;
 
 }
+