about summary refs log tree commit diff
path: root/src/afl-fuzz.c
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2021-02-15 13:51:32 +0100
committerDominik Maier <domenukk@gmail.com>2021-02-15 13:51:32 +0100
commit512f53984cd53d75900e6648720ef7cc7c571ca1 (patch)
tree9129a9e593d889c1b23c447b4ceb978641585474 /src/afl-fuzz.c
parent16ffbb37f5897ca318e747518fdae6b4e56b52ac (diff)
downloadafl++-512f53984cd53d75900e6648720ef7cc7c571ca1.tar.gz
fixed scan-build issues
Diffstat (limited to 'src/afl-fuzz.c')
-rw-r--r--src/afl-fuzz.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index e4139857..e79671e0 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -552,13 +552,22 @@ int main(int argc, char **argv_orig, char **envp) {
 
       case 'F':                                         /* foreign sync dir */
 
-        if (!afl->is_main_node)
+        if (!optarg) { FATAL("Missing path for -F"); }
+        if (!afl->is_main_node) {
+
           FATAL(
               "Option -F can only be specified after the -M option for the "
               "main fuzzer of a fuzzing campaign");
-        if (afl->foreign_sync_cnt >= FOREIGN_SYNCS_MAX)
+
+        }
+
+        if (afl->foreign_sync_cnt >= FOREIGN_SYNCS_MAX) {
+
           FATAL("Maximum %u entried of -F option can be specified",
                 FOREIGN_SYNCS_MAX);
+
+        }
+
         afl->foreign_syncs[afl->foreign_sync_cnt].dir = optarg;
         while (afl->foreign_syncs[afl->foreign_sync_cnt]
                    .dir[strlen(afl->foreign_syncs[afl->foreign_sync_cnt].dir) -
@@ -802,7 +811,7 @@ int main(int argc, char **argv_orig, char **envp) {
 
       case 'l': {
 
-        afl->cmplog_lvl = atoi(optarg);
+        if (optarg) { afl->cmplog_lvl = atoi(optarg); }
         if (afl->cmplog_lvl < 1 || afl->cmplog_lvl > CMPLOG_LVL_MAX) {
 
           FATAL(