about summary refs log tree commit diff
path: root/src/afl-showmap.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-11-15 09:27:54 +0100
committerGitHub <noreply@github.com>2022-11-15 09:27:54 +0100
commit8cdc48f73a17ddd557897f2098937a8ba3bfe184 (patch)
tree9a15fe02c66bd86faf55fbbc11f7ce56c7d20ae1 /src/afl-showmap.c
parent2d640558a09b03e9416b5d87e98cf938b38def9e (diff)
parente5c725c4e0ccfbbff933aab0a3b833d4f21de470 (diff)
downloadafl++-8cdc48f73a17ddd557897f2098937a8ba3bfe184.tar.gz
Merge pull request #1579 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-showmap.c')
-rw-r--r--src/afl-showmap.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index b1b548e5..93339a8f 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -515,11 +515,11 @@ static void showmap_run_target(afl_forkserver_t *fsrv, char **argv) {
     it.it_value.tv_sec = (fsrv->exec_tmout / 1000);
     it.it_value.tv_usec = (fsrv->exec_tmout % 1000) * 1000;
 
-  }
+    signal(SIGALRM, kill_child);
 
-  signal(SIGALRM, kill_child);
+    setitimer(ITIMER_REAL, &it, NULL);
 
-  setitimer(ITIMER_REAL, &it, NULL);
+  }
 
   if (waitpid(fsrv->child_pid, &status, 0) <= 0) { FATAL("waitpid() failed"); }
 
@@ -1016,6 +1016,16 @@ int main(int argc, char **argv_orig, char **envp) {
 
           }
 
+        } else {
+
+          // The forkserver code does not have a way to completely
+          // disable the timeout, so we'll use a very, very long
+          // timeout instead.
+          WARNF(
+              "Setting an execution timeout of 120 seconds ('none' is not "
+              "allowed).");
+          fsrv->exec_tmout = 120 * 1000;
+
         }
 
         break;