Skip to content

Commit

Permalink
fix custom trim for increasing data
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhauser-thc committed Apr 19, 2021
1 parent b41ea92 commit 86a8ef1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/afl-fuzz-mutators.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 86a8ef1

Please sign in to comment.