diff options
author | vanhauser-thc <vh@thc.org> | 2021-04-16 22:58:54 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2021-04-19 11:05:49 +0200 |
commit | 86a8ef168dda766d2f25f15c15c4d3ecf21d0667 (patch) | |
tree | 3f5b44bd985af80bbaf0d3415abdf3c0c3e88006 /src/afl-fuzz-mutators.c | |
parent | b41ea92a679504342bdae2e37b54737a03fb046a (diff) | |
download | afl++-86a8ef168dda766d2f25f15c15c4d3ecf21d0667.tar.gz |
fix custom trim for increasing data
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r-- | src/afl-fuzz-mutators.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c index a47b4f5f..c99d9a4d 100644 --- a/src/afl-fuzz-mutators.c +++ b/src/afl-fuzz-mutators.c @@ -397,8 +397,14 @@ u8 trim_case_custom(afl_state_t *afl, struct queue_entry *q, u8 *in_buf, if (likely(retlen && cksum == q->exec_cksum)) { - q->len = retlen; + if (afl_realloc((void **)&in_buf, retlen) == NULL) { + + FATAL("can not allocate memory for trim"); + + } + memcpy(in_buf, retbuf, retlen); + q->len = retlen; /* Let's save a clean trace, which will be needed by update_bitmap_score once we're done with the trimming stuff. */ |