diff options
author | van Hauser <vh@thc.org> | 2021-08-20 23:54:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-20 23:54:59 +0200 |
commit | 2e15661f184c77ac1fbb6f868c894e946cbb7f17 (patch) | |
tree | 665b9368d2c1908cf71dbc4a76517f88c5317d9a /src/afl-fuzz-mutators.c | |
parent | 32a0d6ac31554a47dca591f8978982758fb87677 (diff) | |
parent | ca9c87dd45d8b9a746a212cbc6ce85b78b637d8c (diff) | |
download | afl++-2e15661f184c77ac1fbb6f868c894e946cbb7f17.tar.gz |
Merge pull request #1074 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r-- | src/afl-fuzz-mutators.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c index 79a47744..5332b9fe 100644 --- a/src/afl-fuzz-mutators.c +++ b/src/afl-fuzz-mutators.c @@ -31,6 +31,45 @@ struct custom_mutator *load_custom_mutator(afl_state_t *, const char *); struct custom_mutator *load_custom_mutator_py(afl_state_t *, char *); #endif +void run_afl_custom_queue_new_entry(afl_state_t *afl, struct queue_entry *q, + u8 *fname, u8 *mother_fname) { + + if (afl->custom_mutators_count) { + + u8 updated = 0; + + LIST_FOREACH(&afl->custom_mutator_list, struct custom_mutator, { + + if (el->afl_custom_queue_new_entry) { + + if (el->afl_custom_queue_new_entry(el->data, fname, mother_fname)) { + + updated = 1; + + } + + } + + }); + + if (updated) { + + struct stat st; + if (stat(fname, &st)) { PFATAL("File %s is gone!", fname); } + if (!st.st_size) { + + FATAL("File %s became empty in custom mutator!", fname); + + } + + q->len = st.st_size; + + } + + } + +} + void setup_custom_mutators(afl_state_t *afl) { /* Try mutator library first */ |