about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authoryangzao <yangzaocn@outlook.com>2023-11-27 10:25:12 -0700
committeryangzao <yangzaocn@outlook.com>2023-11-27 10:25:12 -0700
commit81b43cefdfa99b14628c487dc0183a4c1a21c811 (patch)
tree1d5104615010625ea186d45d9ab957bf14e9dfa1 /src
parentbb523b46482ce212355b32882158cb129d2e8487 (diff)
downloadafl++-81b43cefdfa99b14628c487dc0183a4c1a21c811.tar.gz
merge function
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-run.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index 8d0f2c2d..ae7969a6 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -60,7 +60,18 @@ fuzz_run_target(afl_state_t *afl, afl_forkserver_t *fsrv, u32 timeout) {
 
   fsrv_run_result_t res = afl_fsrv_run_target(fsrv, timeout, &afl->stop_soon);
 
-  post_run(afl);
+  /* 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); }
+
+    });
+
+  }
 
 #ifdef PROFILING
   clock_gettime(CLOCK_REALTIME, &spec);
@@ -1112,20 +1123,3 @@ common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
   return 0;
 
 }
-
-/* Run some code or scripts each time AFL++ executes the target program
-   with afl-fuzz. */
-
-void post_run(afl_state_t *afl) {
-
-  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); }
-
-    });
-
-  }
-
-}