]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
afl: optionally exit right after afl single runmode
authorVictor Julien <victor@inliniac.net>
Tue, 8 Dec 2015 18:55:40 +0000 (19:55 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 12 Apr 2016 13:19:59 +0000 (15:19 +0200)
Exit right away if afl.exit_after_pcap is set to true. Safes time
as fuzzing the shutdown code may not be as interesting.

src/runmode-pcap-file.c

index 4d44814be73b5f4df2e4da086b6425f0aa7cd264..eede9f4d11dcd261d9251c38449af2bd43f1e0e7 100644 (file)
@@ -125,6 +125,12 @@ int RunModeFilePcapSingle(void)
     /* in afl mode we don't spawn a new thread, but run the pipeline
      * in the main thread */
     tv->tm_func(tv);
+    int afl_runmode_exit_immediately = 0;
+    (void)ConfGetBool("afl.exit_after_pcap", &afl_runmode_exit_immediately);
+    if (afl_runmode_exit_immediately) {
+        SCLogNotice("exit because of afl-runmode-exit-after-pcap commandline option");
+        exit(EXIT_SUCCESS);
+    }
 #endif
 
     return 0;