about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-11-02 15:19:56 +0100
committerGitHub <noreply@github.com>2022-11-02 15:19:56 +0100
commita8c1ba0d59e1e52373b482611cf0657d124917c7 (patch)
treeab95d4df2855dd8694879a70ba38f354a9e7a7b2
parentc058ce37bbd578be91b8c5d26161ecb281568725 (diff)
parent1bc7cf759d02ba4ed7a54542379a4c8b71c8be3f (diff)
downloadafl++-a8c1ba0d59e1e52373b482611cf0657d124917c7.tar.gz
Merge pull request #1570 from edmcman/showmap-timeout
Fix -t none in afl-showmap
-rw-r--r--src/afl-showmap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index b1b548e5..0de798fe 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -515,11 +515,10 @@ 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 +1015,11 @@ 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.
+          fsrv->exec_tmout = 120 * 1000;
         }
 
         break;