aboutsummaryrefslogtreecommitdiff
path: root/src/afl-fuzz-init.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-02-26 09:45:43 +0100
committerGitHub <noreply@github.com>2021-02-26 09:45:43 +0100
commit78d96c4dc86ac20e2a6e244017407ccc037ff13b (patch)
treee277f092c27714f75e0c19f9ac8ab18dbfd1745a /src/afl-fuzz-init.c
parent7ae7b0f3732cfd9d82cf9403818012d00faa07c3 (diff)
parentee0ca07f3c9f7c5971440f5dca70a2ee6f37584d (diff)
downloadafl++-78d96c4dc86ac20e2a6e244017407ccc037ff13b.tar.gz
Merge pull request #759 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-init.c')
-rw-r--r--src/afl-fuzz-init.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c
index 702e732d..3dbc4c65 100644
--- a/src/afl-fuzz-init.c
+++ b/src/afl-fuzz-init.c
@@ -882,32 +882,23 @@ void perform_dry_run(afl_state_t *afl) {
if (afl->timeout_given) {
- /* The -t nn+ syntax in the command line sets afl->timeout_given to
- '2' and instructs afl-fuzz to tolerate but skip queue entries that
- time out. */
+ /* if we have a timeout but a timeout value was given then always
+ skip. The '+' meaning has been changed! */
+ WARNF("Test case results in a timeout (skipping)");
+ ++cal_failures;
+ q->cal_failed = CAL_CHANCES;
+ q->disabled = 1;
+ q->perf_score = 0;
- if (afl->timeout_given > 1) {
+ if (!q->was_fuzzed) {
- WARNF("Test case results in a timeout (skipping)");
- q->cal_failed = CAL_CHANCES;
- ++cal_failures;
- break;
+ q->was_fuzzed = 1;
+ --afl->pending_not_fuzzed;
+ --afl->active_paths;
}
- SAYF("\n" cLRD "[-] " cRST
- "The program took more than %u ms to process one of the initial "
- "test cases.\n"
- " Usually, the right thing to do is to relax the -t option - "
- "or to delete it\n"
- " altogether and allow the fuzzer to auto-calibrate. That "
- "said, if you know\n"
- " what you are doing and want to simply skip the unruly test "
- "cases, append\n"
- " '+' at the end of the value passed to -t ('-t %u+').\n",
- afl->fsrv.exec_tmout, afl->fsrv.exec_tmout);
-
- FATAL("Test case '%s' results in a timeout", fn);
+ break;
} else {
@@ -1060,13 +1051,22 @@ void perform_dry_run(afl_state_t *afl) {
p->perf_score = 0;
u32 i = 0;
- while (unlikely(afl->queue_buf[i]->disabled)) {
+ while (unlikely(i < afl->queued_paths && afl->queue_buf[i] &&
+ afl->queue_buf[i]->disabled)) {
++i;
}
- afl->queue = afl->queue_buf[i];
+ if (i < afl->queued_paths && afl->queue_buf[i]) {
+
+ afl->queue = afl->queue_buf[i];
+
+ } else {
+
+ afl->queue = afl->queue_buf[0];
+
+ }
afl->max_depth = 0;
for (i = 0; i < afl->queued_paths; i++) {
@@ -2017,7 +2017,7 @@ void setup_dirs_fds(afl_state_t *afl) {
fprintf(afl->fsrv.plot_file,
"# unix_time, cycles_done, cur_path, paths_total, "
"pending_total, pending_favs, map_size, unique_crashes, "
- "unique_hangs, max_depth, execs_per_sec\n");
+ "unique_hangs, max_depth, execs_per_sec, total_execs, edges_found\n");
fflush(afl->fsrv.plot_file);
/* ignore errors */