about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-05-18 14:45:45 +0200
committervanhauser-thc <vh@thc.org>2023-05-18 14:45:45 +0200
commit53a869b757287e8bebdfcbc96b8abe1729955171 (patch)
treef543215a7d789188535dd60efb3c214ea8514d78 /src
parenteec2c38a6891ea317a287498ce1da2f2c8f6f9ff (diff)
downloadafl++-53a869b757287e8bebdfcbc96b8abe1729955171.tar.gz
act on invalid AFL_CUSTOM_MUTATOR_ONLY usage
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 4339ddd2..e2d8dea5 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -1748,6 +1748,23 @@ int main(int argc, char **argv_orig, char **envp) {
 
   if (afl->afl_env.afl_custom_mutator_only) {
 
+    if (!afl->custom_mutators_count) {
+
+      if (afl->shm.cmplog_mode) {
+
+        WARNF(
+            "No custom mutator loaded, using AFL_CUSTOM_MUTATOR_ONLY is "
+            "pointless and only allowed now to allow experiments with CMPLOG.");
+
+      } else {
+
+        FATAL(
+            "No custom mutator loaded but AFL_CUSTOM_MUTATOR_ONLY specified.");
+
+      }
+
+    }
+
     /* This ensures we don't proceed to havoc/splice */
     afl->custom_only = 1;