aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Yakdan <yakdan@code-intelligence.de>2019-07-27 01:18:30 +0200
committerKhaled Yakdan <yakdan@code-intelligence.de>2019-07-27 01:18:30 +0200
commita949b40d11956f34c51f4546412a73e0400d1ffc (patch)
treeed642fffb1c2a52d7b4603a822c13441ee19e8db
parentb2f0b6f2b49a260cbeba01e54998b7bf62dae1d6 (diff)
downloadafl++-a949b40d11956f34c51f4546412a73e0400d1ffc.tar.gz
Only execute the mutated input when it is not empty
-rw-r--r--afl-fuzz.c10
-rw-r--r--libclang_rt.fuzzer_no_main-x86_64.a.syms3
2 files changed, 6 insertions, 7 deletions
diff --git a/afl-fuzz.c b/afl-fuzz.c
index 35f1af7f..42970e39 100644
--- a/afl-fuzz.c
+++ b/afl-fuzz.c
@@ -5581,10 +5581,12 @@ static u8 fuzz_one(char** argv) {
for (stage_cur = 0 ; stage_cur < stage_max ; stage_cur++) {
size_t orig_size = (size_t) len;
size_t mutated_size = custom_mutator(out_buf, orig_size, mutated_buf, max_seed_size, UR(UINT32_MAX));
- out_buf = ck_realloc(out_buf, mutated_size);
- memcpy(out_buf, mutated_buf, mutated_size);
- if (common_fuzz_stuff(argv, out_buf, (u32)mutated_size)) {
- goto abandon_entry;
+ if (mutated_size > 0) {
+ out_buf = ck_realloc(out_buf, mutated_size);
+ memcpy(out_buf, mutated_buf, mutated_size);
+ if (common_fuzz_stuff(argv, out_buf, (u32) mutated_size)) {
+ goto abandon_entry;
+ }
}
}
diff --git a/libclang_rt.fuzzer_no_main-x86_64.a.syms b/libclang_rt.fuzzer_no_main-x86_64.a.syms
deleted file mode 100644
index 289454c8..00000000
--- a/libclang_rt.fuzzer_no_main-x86_64.a.syms
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- LLVMFuzzerMutate;
-}; \ No newline at end of file