This commit is contained in:
Andrea Fioraldi
2020-08-03 11:15:12 +02:00
parent e0d1529061
commit 491cee669f

View File

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