about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-11-14 12:28:51 +0100
committerhexcoder- <heiko@hexco.de>2020-11-14 12:28:51 +0100
commit30cd8a8397419b3eedb6ee939e290b4c6b8c2cf1 (patch)
tree835b143a7f20e82548041ccb1b317f511ac838a9 /src
parentbd313d4039d094c0caf657b4ed1a666da7eded1b (diff)
downloadafl++-30cd8a8397419b3eedb6ee939e290b4c6b8c2cf1.tar.gz
fix non instrumented mode, fix check_binary
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-init.c6
-rw-r--r--src/afl-fuzz.c10
2 files changed, 9 insertions, 7 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c
index 19a8d77b..01929a0a 100644
--- a/src/afl-fuzz-init.c
+++ b/src/afl-fuzz-init.c
@@ -2300,12 +2300,6 @@ void fix_up_sync(afl_state_t *afl) {
 
   u8 *x = afl->sync_id;
 
-  if (afl->non_instrumented_mode) {
-
-    FATAL("-S / -M and -n are mutually exclusive");
-
-  }
-
   while (*x) {
 
     if (!isalnum(*x) && *x != '_' && *x != '-') {
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 59772b3f..f662b308 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -435,6 +435,7 @@ 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->sync_id) { FATAL("Multiple -S or -M options not supported"); }
         afl->sync_id = ck_strdup(optarg);
         afl->skip_deterministic = 0;  // force determinsitic fuzzing
@@ -464,6 +465,7 @@ 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->sync_id) { FATAL("Multiple -S or -M options not supported"); }
         afl->sync_id = ck_strdup(optarg);
         afl->is_secondary_node = 1;
@@ -620,6 +622,12 @@ int main(int argc, char **argv_orig, char **envp) {
 
       case 'n':                                                /* dumb mode */
 
+        if (afl->is_main_node || afl->is_secondary_node) {
+
+          FATAL("Non instrumented mode is not supported with -M / -S");
+
+        }
+
         if (afl->non_instrumented_mode) {
 
           FATAL("Multiple -n options not supported");
@@ -1342,7 +1350,7 @@ int main(int argc, char **argv_orig, char **envp) {
 
   }
 
-  if (afl->non_instrumented_mode) check_binary(afl, argv[optind]);
+  if (!afl->non_instrumented_mode) check_binary(afl, argv[optind]);
 
   if (afl->shmem_testcase_mode) { setup_testcase_shmem(afl); }