fix expand havoc for ..._only modes

This commit is contained in:
van Hauser
2020-08-03 13:13:32 +02:00
parent f335c48686
commit 409e4ae945
6 changed files with 46 additions and 40 deletions

View File

@ -673,15 +673,15 @@ static u8 rtn_extend_encoding(afl_state_t *afl, struct cmp_header *h,
for (i = 0; i < its_len; ++i) {
if (pattern[i] != buf[idx + i] ||
o_pattern[i] != orig_buf[idx + i] || *status == 1) {
if (pattern[i] != buf[idx + i] || o_pattern[i] != orig_buf[idx + i] ||
*status == 1) {
break;
}
buf[idx + i] = repl[i];
if (unlikely(its_fuzz(afl, buf, len, status))) { return 1; }
}
@ -727,7 +727,7 @@ static u8 rtn_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u32 len) {
}
for (idx = 0; idx < len && fails < 8; ++idx) {
if (unlikely(rtn_extend_encoding(afl, h, o->v0, o->v1, orig_o->v0, idx,
orig_buf, buf, len, &status))) {