aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-07-12 20:32:07 +0200
committervan Hauser <vh@thc.org>2019-07-12 20:32:07 +0200
commit5508e3085480878b5e27baf4f98625e6cf4be013 (patch)
tree339e9e24e87f2c23c7eb1135688f66b1c669abdc
parent3e14d63a0ae0e574d81d3d58c75a4b751764ac49 (diff)
downloadafl++-5508e3085480878b5e27baf4f98625e6cf4be013.tar.gz
-E fix
-rw-r--r--afl-fuzz.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/afl-fuzz.c b/afl-fuzz.c
index 1e27cb34..d8d45223 100644
--- a/afl-fuzz.c
+++ b/afl-fuzz.c
@@ -87,7 +87,7 @@ u64 total_pacemaker_time = 0;
u64 total_puppet_find = 0;
u64 temp_puppet_find = 0;
u64 most_time_key = 0;
-u64 most_time_puppet = 0;
+u64 most_time = 0;
u64 most_execs_key = 0;
u64 most_execs = 0;
u64 old_hit_count = 0;
@@ -12258,7 +12258,7 @@ int main(int argc, char** argv) {
case 'V': {
most_time_key = 1;
- if (sscanf(optarg, "%llu", &most_time_puppet) < 1 || optarg[0] == '-')
+ if (sscanf(optarg, "%llu", &most_time) < 1 || optarg[0] == '-')
FATAL("Bad syntax used for -V");
}
break;
@@ -12592,12 +12592,16 @@ int main(int argc, char** argv) {
if (most_time_key == 1) {
u64 cur_ms_lv = get_cur_time();
- if (most_time_puppet * 1000 < cur_ms_lv - start_time)
+ if (most_time * 1000 < cur_ms_lv - start_time) {
+ most_time_key = 2;
break;
+ }
}
if (most_execs_key == 1) {
- if (most_execs >= total_execs)
+ if (most_execs <= total_execs) {
+ most_execs_key = 2;
break;
+ }
}
}
@@ -12612,6 +12616,11 @@ stop_fuzzing:
SAYF(CURSOR_SHOW cLRD "\n\n+++ Testing aborted %s +++\n" cRST,
stop_soon == 2 ? "programmatically" : "by user");
+ if (most_time_key == 2)
+ SAYF(cYEL "[!] " cRST "Time limit was reached\n");
+ if (most_execs_key == 2)
+ SAYF(cYEL "[!] " cRST "Execution limit was reached\n");
+
/* Running for more than 30 minutes but still doing first cycle? */
if (queue_cycle == 1 && get_cur_time() - start_time > 30 * 60 * 1000) {