about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index f662b308..6b19d648 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -435,8 +435,12 @@ int main(int argc, char **argv_orig, char **envp) {
 
         u8 *c;
 
-        if (afl->non_instrumented_mode) { FATAL("-M is not supported in non-instrumented mode "); }
+        if (afl->non_instrumented_mode) { FATAL("-M is not supported in non-instrumented mode"); }
         if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
+
+	/* sanity check for argument: should not begin with '-' (possible option) */
+	if (optarg && *optarg == '-') { FATAL("argument for -M started with a dash '-', which is used for options"); }
+
         afl->sync_id = ck_strdup(optarg);
         afl->skip_deterministic = 0;  // force determinsitic fuzzing
         afl->old_seed_selection = 1;  // force old queue walking seed selection
@@ -465,8 +469,12 @@ int main(int argc, char **argv_orig, char **envp) {
 
       case 'S':                                        /* secondary sync id */
 
-        if (afl->non_instrumented_mode) { FATAL("-S is not supported in non-instrumented mode "); }
+        if (afl->non_instrumented_mode) { FATAL("-S is not supported in non-instrumented mode"); }
         if (afl->sync_id) { FATAL("Multiple -S or -M options not supported"); }
+
+	/* sanity check for argument: should not begin with '-' (possible option) */
+	if (optarg && *optarg == '-') { FATAL("argument for -M started with a dash '-', which is used for options"); }
+
         afl->sync_id = ck_strdup(optarg);
         afl->is_secondary_node = 1;
         break;