aboutsummaryrefslogtreecommitdiff
path: root/custom_mutators
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-07-09 10:32:14 +0200
committervanhauser-thc <vh@thc.org>2021-07-09 10:32:14 +0200
commite1d5009229fb5cea5845cd08e0abdc8fe440ee86 (patch)
tree5855fd6e27d83b5d7eb2c455a8bb3bc7b43403a4 /custom_mutators
parentfd4acc935efe78a340395ca386b856930f7e6b22 (diff)
downloadafl++-e1d5009229fb5cea5845cd08e0abdc8fe440ee86.tar.gz
fixes
Diffstat (limited to 'custom_mutators')
-rw-r--r--custom_mutators/gramatron/Makefile7
-rw-r--r--custom_mutators/gramatron/README.md (renamed from custom_mutators/grammatron/README.md)0
-rw-r--r--custom_mutators/gramatron/gramfuzz-helpers.c (renamed from custom_mutators/grammatron/gramfuzz-helpers.c)0
-rw-r--r--custom_mutators/gramatron/gramfuzz-mutators.c (renamed from custom_mutators/grammatron/gramfuzz-mutators.c)0
-rw-r--r--custom_mutators/gramatron/gramfuzz-util.c (renamed from custom_mutators/grammatron/gramfuzz-util.c)0
-rw-r--r--custom_mutators/gramatron/gramfuzz.c (renamed from custom_mutators/grammatron/gramfuzz.c)17
-rw-r--r--custom_mutators/gramatron/gramfuzz.h (renamed from custom_mutators/grammatron/gramfuzz.h)0
-rw-r--r--custom_mutators/gramatron/grammars/js/source.json (renamed from custom_mutators/grammatron/grammars/js/source.json)0
-rw-r--r--custom_mutators/gramatron/grammars/js/source_automata.json (renamed from custom_mutators/grammatron/grammars/js/source_automata.json)0
-rw-r--r--custom_mutators/gramatron/grammars/php/source.json (renamed from custom_mutators/grammatron/grammars/php/source.json)0
-rw-r--r--custom_mutators/gramatron/grammars/php/source_automata.json (renamed from custom_mutators/grammatron/grammars/php/source_automata.json)0
-rw-r--r--custom_mutators/gramatron/grammars/ruby/source.json (renamed from custom_mutators/grammatron/grammars/ruby/source.json)0
-rw-r--r--custom_mutators/gramatron/grammars/ruby/source_automata.json (renamed from custom_mutators/grammatron/grammars/ruby/source_automata.json)0
-rw-r--r--custom_mutators/gramatron/hashmap.c (renamed from custom_mutators/grammatron/hashmap.c)0
-rw-r--r--custom_mutators/gramatron/hashmap.h (renamed from custom_mutators/grammatron/hashmap.h)0
-rw-r--r--custom_mutators/gramatron/preprocess/construct_automata.py (renamed from custom_mutators/grammatron/preprocess/construct_automata.py)0
-rw-r--r--custom_mutators/gramatron/preprocess/gnf_converter.py (renamed from custom_mutators/grammatron/preprocess/gnf_converter.py)0
-rwxr-xr-xcustom_mutators/gramatron/preprocess/prep_automaton.sh (renamed from custom_mutators/grammatron/preprocess/prep_automaton.sh)0
-rw-r--r--custom_mutators/gramatron/test.c (renamed from custom_mutators/grammatron/test.c)0
-rw-r--r--custom_mutators/gramatron/test.h (renamed from custom_mutators/grammatron/test.h)0
-rw-r--r--custom_mutators/gramatron/utarray.h (renamed from custom_mutators/grammatron/utarray.h)0
-rw-r--r--custom_mutators/gramatron/uthash.h (renamed from custom_mutators/grammatron/uthash.h)0
-rw-r--r--custom_mutators/grammatron/Makefile7
23 files changed, 17 insertions, 14 deletions
diff --git a/custom_mutators/gramatron/Makefile b/custom_mutators/gramatron/Makefile
new file mode 100644
index 00000000..d24f3dd4
--- /dev/null
+++ b/custom_mutators/gramatron/Makefile
@@ -0,0 +1,7 @@
+all: gramatron.so
+
+gramatron.so: gramfuzz.c gramfuzz.h gramfuzz-helpers.c gramfuzz-mutators.c gramfuzz-util.c hashmap.c hashmap.h test.c test.h utarray.h uthash.h
+ $(CC) -O3 -g -fPIC -Wno-unused-result -Wl,--allow-multiple-definition -I../../include -o gramatron.so -shared -I. -I/prg/dev/include gramfuzz.c gramfuzz-helpers.c gramfuzz-mutators.c gramfuzz-util.c hashmap.c test.c -ljson-c
+
+clean:
+ rm -f gramatron.so
diff --git a/custom_mutators/grammatron/README.md b/custom_mutators/gramatron/README.md
index 7f73cf2c..7f73cf2c 100644
--- a/custom_mutators/grammatron/README.md
+++ b/custom_mutators/gramatron/README.md
diff --git a/custom_mutators/grammatron/gramfuzz-helpers.c b/custom_mutators/gramatron/gramfuzz-helpers.c
index f894c850..f894c850 100644
--- a/custom_mutators/grammatron/gramfuzz-helpers.c
+++ b/custom_mutators/gramatron/gramfuzz-helpers.c
diff --git a/custom_mutators/grammatron/gramfuzz-mutators.c b/custom_mutators/gramatron/gramfuzz-mutators.c
index 0255e1d0..0255e1d0 100644
--- a/custom_mutators/grammatron/gramfuzz-mutators.c
+++ b/custom_mutators/gramatron/gramfuzz-mutators.c
diff --git a/custom_mutators/grammatron/gramfuzz-util.c b/custom_mutators/gramatron/gramfuzz-util.c
index cb2e1b59..cb2e1b59 100644
--- a/custom_mutators/grammatron/gramfuzz-util.c
+++ b/custom_mutators/gramatron/gramfuzz-util.c
diff --git a/custom_mutators/grammatron/gramfuzz.c b/custom_mutators/gramatron/gramfuzz.c
index 0d350c9f..5c96ddce 100644
--- a/custom_mutators/grammatron/gramfuzz.c
+++ b/custom_mutators/gramatron/gramfuzz.c
@@ -219,7 +219,7 @@ size_t afl_custom_fuzz(my_mutator_t *data, uint8_t *buf, size_t buf_size,
data->mut_alloced = 1;
free(spliceCandidate->start);
free(spliceCandidate);
- free(automaton_fn);
+ ck_free(automaton_fn);
} else { // Generate an input from scratch
@@ -251,9 +251,9 @@ size_t afl_custom_fuzz(my_mutator_t *data, uint8_t *buf, size_t buf_size,
* @param filename_new_queue File name of the new queue entry
* @param filename_orig_queue File name of the original queue entry
*/
-void afl_custom_queue_new_entry(my_mutator_t * data,
- const uint8_t *filename_new_queue,
- const uint8_t *filename_orig_queue) {
+u8 afl_custom_queue_new_entry(my_mutator_t * data,
+ const uint8_t *filename_new_queue,
+ const uint8_t *filename_orig_queue) {
// get the filename
u8 * automaton_fn, *unparsed_input;
@@ -270,6 +270,7 @@ void afl_custom_queue_new_entry(my_mutator_t * data,
new_input = gen_input(pda, NULL);
write_input(new_input, automaton_fn);
+
// Update the placeholder file
if (unlink(filename_new_queue)) {
@@ -282,15 +283,17 @@ void afl_custom_queue_new_entry(my_mutator_t * data,
S_IRUSR | S_IWUSR);
if (fd < 0) { PFATAL("Failed to update file '%s'", filename_new_queue); }
int written = write(fd, unparsed_input, new_input->inputlen + 1);
+ close(fd);
+
free(new_input->start);
free(new_input);
free(unparsed_input);
}
- free(automaton_fn);
+ ck_free(automaton_fn);
- return;
+ return 1;
}
@@ -388,7 +391,7 @@ uint8_t afl_custom_queue_get(my_mutator_t *data, const uint8_t *filename) {
// data->getdupesret = get_dupes(data->orig_walk, &data->recurlen);
- free(automaton_fn);
+ ck_free(automaton_fn);
return 1;
}
diff --git a/custom_mutators/grammatron/gramfuzz.h b/custom_mutators/gramatron/gramfuzz.h
index 811e0af7..811e0af7 100644
--- a/custom_mutators/grammatron/gramfuzz.h
+++ b/custom_mutators/gramatron/gramfuzz.h
diff --git a/custom_mutators/grammatron/grammars/js/source.json b/custom_mutators/gramatron/grammars/js/source.json
index 4c1a90d3..4c1a90d3 100644
--- a/custom_mutators/grammatron/grammars/js/source.json
+++ b/custom_mutators/gramatron/grammars/js/source.json
diff --git a/custom_mutators/grammatron/grammars/js/source_automata.json b/custom_mutators/gramatron/grammars/js/source_automata.json
index b5055919..b5055919 100644
--- a/custom_mutators/grammatron/grammars/js/source_automata.json
+++ b/custom_mutators/gramatron/grammars/js/source_automata.json
diff --git a/custom_mutators/grammatron/grammars/php/source.json b/custom_mutators/gramatron/grammars/php/source.json
index 3b2e4895..3b2e4895 100644
--- a/custom_mutators/grammatron/grammars/php/source.json
+++ b/custom_mutators/gramatron/grammars/php/source.json
diff --git a/custom_mutators/grammatron/grammars/php/source_automata.json b/custom_mutators/gramatron/grammars/php/source_automata.json
index 0cfd23ec..0cfd23ec 100644
--- a/custom_mutators/grammatron/grammars/php/source_automata.json
+++ b/custom_mutators/gramatron/grammars/php/source_automata.json
diff --git a/custom_mutators/grammatron/grammars/ruby/source.json b/custom_mutators/gramatron/grammars/ruby/source.json
index df969f5f..df969f5f 100644
--- a/custom_mutators/grammatron/grammars/ruby/source.json
+++ b/custom_mutators/gramatron/grammars/ruby/source.json
diff --git a/custom_mutators/grammatron/grammars/ruby/source_automata.json b/custom_mutators/gramatron/grammars/ruby/source_automata.json
index a1ac13e5..a1ac13e5 100644
--- a/custom_mutators/grammatron/grammars/ruby/source_automata.json
+++ b/custom_mutators/gramatron/grammars/ruby/source_automata.json
diff --git a/custom_mutators/grammatron/hashmap.c b/custom_mutators/gramatron/hashmap.c
index 09715b87..09715b87 100644
--- a/custom_mutators/grammatron/hashmap.c
+++ b/custom_mutators/gramatron/hashmap.c
diff --git a/custom_mutators/grammatron/hashmap.h b/custom_mutators/gramatron/hashmap.h
index bb66ad2e..bb66ad2e 100644
--- a/custom_mutators/grammatron/hashmap.h
+++ b/custom_mutators/gramatron/hashmap.h
diff --git a/custom_mutators/grammatron/preprocess/construct_automata.py b/custom_mutators/gramatron/preprocess/construct_automata.py
index b9e84aa8..b9e84aa8 100644
--- a/custom_mutators/grammatron/preprocess/construct_automata.py
+++ b/custom_mutators/gramatron/preprocess/construct_automata.py
diff --git a/custom_mutators/grammatron/preprocess/gnf_converter.py b/custom_mutators/gramatron/preprocess/gnf_converter.py
index 1e7c8b6c..1e7c8b6c 100644
--- a/custom_mutators/grammatron/preprocess/gnf_converter.py
+++ b/custom_mutators/gramatron/preprocess/gnf_converter.py
diff --git a/custom_mutators/grammatron/preprocess/prep_automaton.sh b/custom_mutators/gramatron/preprocess/prep_automaton.sh
index 28d99fb0..28d99fb0 100755
--- a/custom_mutators/grammatron/preprocess/prep_automaton.sh
+++ b/custom_mutators/gramatron/preprocess/prep_automaton.sh
diff --git a/custom_mutators/grammatron/test.c b/custom_mutators/gramatron/test.c
index 0dfbc197..0dfbc197 100644
--- a/custom_mutators/grammatron/test.c
+++ b/custom_mutators/gramatron/test.c
diff --git a/custom_mutators/grammatron/test.h b/custom_mutators/gramatron/test.h
index 857cb5fc..857cb5fc 100644
--- a/custom_mutators/grammatron/test.h
+++ b/custom_mutators/gramatron/test.h
diff --git a/custom_mutators/grammatron/utarray.h b/custom_mutators/gramatron/utarray.h
index 5c0d272b..5c0d272b 100644
--- a/custom_mutators/grammatron/utarray.h
+++ b/custom_mutators/gramatron/utarray.h
diff --git a/custom_mutators/grammatron/uthash.h b/custom_mutators/gramatron/uthash.h
index 5957899a..5957899a 100644
--- a/custom_mutators/grammatron/uthash.h
+++ b/custom_mutators/gramatron/uthash.h
diff --git a/custom_mutators/grammatron/Makefile b/custom_mutators/grammatron/Makefile
deleted file mode 100644
index 892b5c78..00000000
--- a/custom_mutators/grammatron/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-all: gramatron.so
-
-gramatron.so: gramfuzz.c gramfuzz.h gramfuzz-helpers.c gramfuzz-mutators.c gramfuzz-util.c hashmap.c hashmap.h test.c test.h utarray.h uthash.h
- $(CC) -O3 -g -fPIC -Wl,--allow-multiple-definition -I../../include -o gramatron.so -shared -I. -I/prg/dev/include gramfuzz.c gramfuzz-helpers.c gramfuzz-mutators.c gramfuzz-util.c hashmap.c test.c
-
-clean:
- rm -f gramatron.so