diff options
author | van Hauser <vh@thc.org> | 2020-12-18 09:36:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 09:36:22 +0100 |
commit | 3ee12009c0ef79e8a48e8e1066d9ff9193b37d3a (patch) | |
tree | cd53e186830019befe67bb90a2a01d4be781c439 /src | |
parent | 0011f2047bdd3e1adc25de4388edd609dc27bc85 (diff) | |
parent | 79c98731c9864d457df06cfb4e1c15137e0cf832 (diff) | |
download | afl++-3ee12009c0ef79e8a48e8e1066d9ff9193b37d3a.tar.gz |
Merge pull request #641 from AFLplusplus/dev
Dev
Diffstat (limited to 'src')
-rw-r--r-- | src/afl-common.c | 5 | ||||
-rw-r--r-- | src/afl-fuzz-stats.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/afl-common.c b/src/afl-common.c index 4df22394..6dc8abe0 100644 --- a/src/afl-common.c +++ b/src/afl-common.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include <stdio.h> #include <strings.h> +#include <math.h> #include "debug.h" #include "alloc-inl.h" @@ -786,6 +787,10 @@ u8 *u_stringify_float(u8 *buf, double val) { sprintf(buf, "%0.01f", val); + } else if (unlikely(isnan(val) || isfinite(val))) { + + strcpy(buf, "999.9"); + } else { return u_stringify_int(buf, (u64)val); diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c index 321bbb35..50e2ef15 100644 --- a/src/afl-fuzz-stats.c +++ b/src/afl-fuzz-stats.c @@ -371,6 +371,8 @@ void show_stats(afl_state_t *afl) { if (!afl->stats_last_execs) { + if (unlikely(cur_ms == afl->start_time)) --afl->start_time; + afl->stats_avg_exec = ((double)afl->fsrv.total_execs) * 1000 / (cur_ms - afl->start_time); |