about summary refs log tree commit diff
path: root/src/afl-fuzz-state.c
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2022-10-24 20:06:57 +0200
committervanhauser-thc <vh@thc.org>2022-10-24 20:06:57 +0200
commit05e0825d66d938308842c25c4c74b5cdd4a885eb (patch)
tree724dd6978ebb10f52c4bdda86eb44a5494b33409 /src/afl-fuzz-state.c
parent02502c1a543b2150bec78fbac2f0fcf1f4cd7a5a (diff)
downloadafl++-05e0825d66d938308842c25c4c74b5cdd4a885eb.tar.gz
changelog update
Diffstat (limited to 'src/afl-fuzz-state.c')
-rw-r--r--src/afl-fuzz-state.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/afl-fuzz-state.c b/src/afl-fuzz-state.c
index ae6cb6c7..8bd465f0 100644
--- a/src/afl-fuzz-state.c
+++ b/src/afl-fuzz-state.c
@@ -485,12 +485,14 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
 #endif
 
           } else if (!strncmp(env, "AFL_KILL_SIGNAL",
+
                               afl_environment_variable_len)) {
 
             afl->afl_env.afl_child_kill_signal =
                 (u8 *)get_afl_env(afl_environment_variables[i]);
 
           } else if (!strncmp(env, "AFL_FORK_SERVER_KILL_SIGNAL",
+
                               afl_environment_variable_len)) {
 
             afl->afl_env.afl_fsrv_kill_signal =
@@ -659,12 +661,17 @@ void afl_states_stop(void) {
   });
 
   LIST_FOREACH(&afl_states, afl_state_t, {
-    /* NOTE: We need to make sure that the parent (the forkserver) reap the child (see below). */
-    if (el->fsrv.child_pid > 0) kill(el->fsrv.child_pid, el->fsrv.child_kill_signal);
+
+    /* NOTE: We need to make sure that the parent (the forkserver) reap the
+     * child (see below). */
+    if (el->fsrv.child_pid > 0)
+      kill(el->fsrv.child_pid, el->fsrv.child_kill_signal);
     if (el->fsrv.fsrv_pid > 0) {
+
       kill(el->fsrv.fsrv_pid, el->fsrv.fsrv_kill_signal);
       /* Make sure the forkserver does not end up as zombie. */
       waitpid(el->fsrv.fsrv_pid, NULL, 0);
+
     }
 
   });
@@ -682,3 +689,4 @@ void afl_states_request_skip(void) {
   LIST_FOREACH(&afl_states, afl_state_t, { el->skip_requested = 1; });
 
 }
+