mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 17:21:33 +00:00
avoid duplicated code
This commit is contained in:
parent
bedb38e216
commit
dffd6537ae
@ -1413,65 +1413,50 @@ void perform_dry_run(afl_state_t *afl) {
|
||||
if (!q || q->disabled || q->cal_failed || !q->exec_cksum) { continue; }
|
||||
u32 done = 0;
|
||||
|
||||
for (i = idx + 1;
|
||||
likely(i < afl->queued_items && afl->queue_buf[i] && !done); ++i) {
|
||||
for (i = idx + 1; likely(i < afl->queued_items && afl->queue_buf[i]); ++i) {
|
||||
|
||||
struct queue_entry *p = afl->queue_buf[i];
|
||||
if (p->disabled || p->cal_failed || !p->exec_cksum) { continue; }
|
||||
if (p->exec_cksum != q->exec_cksum) continue;
|
||||
|
||||
if (p->exec_cksum == q->exec_cksum) {
|
||||
duplicates = 1;
|
||||
|
||||
duplicates = 1;
|
||||
// we keep the shorter file
|
||||
struct queue_entry *to_disable, *to_keep;
|
||||
if (p->len >= q->len) {
|
||||
|
||||
// we keep the shorter file
|
||||
if (p->len >= q->len) {
|
||||
to_disable = p;
|
||||
to_keep = q;
|
||||
|
||||
if (!p->was_fuzzed) {
|
||||
} else {
|
||||
|
||||
p->was_fuzzed = 1;
|
||||
afl->reinit_table = 1;
|
||||
--afl->pending_not_fuzzed;
|
||||
--afl->active_items;
|
||||
|
||||
}
|
||||
|
||||
p->disabled = 1;
|
||||
p->perf_score = 0;
|
||||
|
||||
if (afl->debug) {
|
||||
|
||||
WARNF("Same coverage - %s is kept active, %s is disabled.",
|
||||
q->fname, p->fname);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (!q->was_fuzzed) {
|
||||
|
||||
q->was_fuzzed = 1;
|
||||
afl->reinit_table = 1;
|
||||
--afl->pending_not_fuzzed;
|
||||
--afl->active_items;
|
||||
|
||||
}
|
||||
|
||||
q->disabled = 1;
|
||||
q->perf_score = 0;
|
||||
|
||||
if (afl->debug) {
|
||||
|
||||
WARNF("Same coverage - %s is kept active, %s is disabled.",
|
||||
p->fname, q->fname);
|
||||
|
||||
}
|
||||
|
||||
done = 1; // end inner loop because outer loop entry is disabled now
|
||||
|
||||
}
|
||||
to_disable = q;
|
||||
to_keep = p;
|
||||
|
||||
}
|
||||
|
||||
if (!to_disable->was_fuzzed) {
|
||||
|
||||
to_disable->was_fuzzed = 1;
|
||||
afl->reinit_table = 1;
|
||||
--afl->pending_not_fuzzed;
|
||||
--afl->active_items;
|
||||
|
||||
}
|
||||
|
||||
to_disable->disabled = 1;
|
||||
to_disable->perf_score = 0;
|
||||
|
||||
if (afl->debug) {
|
||||
|
||||
WARNF("Same coverage - %s is kept active, %s is disabled.",
|
||||
to_keep->fname, to_disable->fname);
|
||||
|
||||
}
|
||||
|
||||
// end inner loop because outer loop entry is disabled now
|
||||
if (to_disable == q) break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user