about summary refs log tree commit diff
path: root/test/test-custom-mutator.c
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-03 09:39:12 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-03 09:39:12 +0200
commit8610b0e40677846ba65de55fcaedd2ebee66a511 (patch)
treef5b6409fe840ac69417e348795b69cbeb0a072fc /test/test-custom-mutator.c
parentffb4767fc1adf2383173e5655d4f1fcf7e0982b6 (diff)
parent97cae2df9975589eb05a543f92c6ba232242fd7b (diff)
downloadafl++-8610b0e40677846ba65de55fcaedd2ebee66a511.tar.gz
Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev
Diffstat (limited to 'test/test-custom-mutator.c')
-rw-r--r--test/test-custom-mutator.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test-custom-mutator.c b/test/test-custom-mutator.c
new file mode 100644
index 00000000..83baafab
--- /dev/null
+++ b/test/test-custom-mutator.c
@@ -0,0 +1,19 @@
+/**
+ * Reference: https://github.com/bruce30262/libprotobuf-mutator_fuzzing_learning/blob/master/4_libprotobuf_aflpp_custom_mutator/vuln.c
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+    char str[100];
+    read(0, str, 100);
+    if( str[6] == 'A') {
+        abort();
+    }
+    return 0;
+}