aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-04-13 11:44:39 +0200
committervanhauser-thc <vh@thc.org>2023-04-13 11:44:39 +0200
commit6cc8d607fb24e060591ece4b42d83fc06de68fc6 (patch)
tree247daa2e572544c999305c59f5fd25eca7a3944f /src
parent824385f52ce3133ecd033e587aa1a3b324adf76c (diff)
downloadafl++-6cc8d607fb24e060591ece4b42d83fc06de68fc6.tar.gz
remove -z option, use -p mmopt instead
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-queue.c14
-rw-r--r--src/afl-fuzz.c7
2 files changed, 5 insertions, 16 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index 6fc3c743..8ad7cd97 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -149,21 +149,15 @@ void create_alias_table(afl_state_t *afl) {
}
- if (unlikely(afl->prefer_new) && afl->queued_discovered) {
+ if (unlikely(afl->schedule == MMOPT) && afl->queued_discovered) {
- double avg_weight = sum / active;
+ u32 cnt = afl->queued_discovered >= 5 ? 5 : afl->queued_discovered;
- for (i = n - afl->queued_discovered; i < n; i++) {
+ for (i = n - cnt; i < n; i++) {
struct queue_entry *q = afl->queue_buf[i];
- if (likely(!q->disabled) && q->weight > avg_weight) {
-
- double prev_weight = q->weight;
- q->weight *= (2.0 * (i / n));
- sum += (q->weight - prev_weight);
-
- }
+ if (likely(!q->disabled)) { q->weight *= 2.0; }
}
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index a0c322da..5ba54d0b 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -132,7 +132,6 @@ static void usage(u8 *argv0, int more_help) {
" fast(default), explore, exploit, seek, rare, mmopt, "
"coe, lin\n"
" quad -- see docs/FAQ.md for more information\n"
- " -z - prefer new coverage findings when fuzzing\n"
" -f file - location read by the fuzzed program (default: stdin "
"or @@)\n"
" -t msec - timeout for each run (auto-scaled, default %u ms). "
@@ -556,7 +555,7 @@ int main(int argc, char **argv_orig, char **envp) {
while (
(opt = getopt(
argc, argv,
- "+Ab:B:c:CdDe:E:hi:I:f:F:g:G:l:L:m:M:nNOo:p:RQs:S:t:T:UV:WXx:YzZ")) >
+ "+Ab:B:c:CdDe:E:hi:I:f:F:g:G:l:L:m:M:nNOo:p:RQs:S:t:T:UV:WXx:YZ")) >
0) {
switch (opt) {
@@ -569,10 +568,6 @@ int main(int argc, char **argv_orig, char **envp) {
afl->max_length = atoi(optarg);
break;
- case 'z':
- afl->prefer_new = 1;
- break;
-
case 'Z':
afl->old_seed_selection = 1;
break;