about summary refs log tree commit diff
path: root/src/afl-showmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/afl-showmap.c')
-rw-r--r--src/afl-showmap.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 2c9c38ed..5c9d38e0 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -1116,33 +1116,8 @@ int main(int argc, char **argv_orig, char **envp) {
 
     }
 
-    fsrv->kill_signal = SIGKILL;
-    char *afl_kill_signal_env = getenv("AFL_KILL_SIGNAL");
-    if (afl_kill_signal_env && afl_kill_signal_env[0]) {
-
-      char *endptr;
-      u8    signal_code;
-      signal_code = (u8)strtoul(afl_kill_signal_env, &endptr, 10);
-      /* Did we manage to parse the full string? */
-      if (*endptr != '\0' || endptr == afl_kill_signal_env) {
-
-        FATAL("Invalid AFL_KILL_SIGNAL: %s (expected unsigned int)",
-              afl_kill_signal_env);
-
-      }
-
-      fsrv->kill_signal = signal_code;
-
-    } else {
-
-      char *sigstr = alloc_printf("%d", (int)SIGKILL);
-      if (!sigstr) { FATAL("Failed to alloc mem for signal buf"); }
-
-      /* Set the env for signal handler */
-      setenv("AFL_KILL_SIGNAL", sigstr, 1);
-      free(sigstr);
-
-    }
+    fsrv->kill_signal =
+        parse_afl_kill_signal_env(getenv("AFL_KILL_SIGNAL"), SIGKILL);
 
     if (getenv("AFL_CRASH_EXITCODE")) {