diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-03-28 12:58:56 +0100 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-03-28 12:58:56 +0100 |
commit | 4c11ef5d20ee84be91ceaceb432b7a67fb089484 (patch) | |
tree | a827a963f64a52631052faa6b1ea0fa74dd799b8 /src/afl-fuzz-mutators.c | |
parent | 6ac40e2cc5edab506d716e33f0cba356690a30c6 (diff) | |
download | afl++-4c11ef5d20ee84be91ceaceb432b7a67fb089484.tar.gz |
error handling for custom mutators
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r-- | src/afl-fuzz-mutators.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c index f14a57bb..90d7de40 100644 --- a/src/afl-fuzz-mutators.c +++ b/src/afl-fuzz-mutators.c @@ -213,7 +213,7 @@ u8 trim_case_custom(afl_state_t *afl, struct queue_entry *q, u8 *in_buf) { afl->stage_cur = 0; afl->stage_max = afl->mutator->afl_custom_init_trim(afl->mutator->data, in_buf, q->len); - + if (unlikely(afl->stage_max) < 0) FATAL("custom_init_trim error ret: %d", afl->stage_max); if (afl->not_on_tty && afl->debug) SAYF("[Custom Trimming] START: Max %d iterations, %u bytes", afl->stage_max, q->len); @@ -273,6 +273,7 @@ u8 trim_case_custom(afl_state_t *afl, struct queue_entry *q, u8 *in_buf) { /* Tell the custom mutator that the trimming was unsuccessful */ afl->stage_cur = afl->mutator->afl_custom_post_trim(afl->mutator->data, 0); + if (unlikely(afl->stage_cur < 0)) FATAL("Error ret in custom_post_trim: %d", afl->stage_cur); if (afl->not_on_tty && afl->debug) SAYF("[Custom Trimming] FAILURE: %d/%d iterations", afl->stage_cur, afl->stage_max); |