diff options
author | van Hauser <vh@thc.org> | 2020-12-17 22:57:28 +0100 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-12-17 22:57:28 +0100 |
commit | fd6bff727a860220bdd035952a7666c60f444b3f (patch) | |
tree | dada4f1e26de6e2a71dfe237326a896a66abcd7f /src/afl-common.c | |
parent | 14c67f15c98b16bb0c22f6a94d66d714bf61af5a (diff) | |
download | afl++-fd6bff727a860220bdd035952a7666c60f444b3f.tar.gz |
fix crash for very fast targets
Diffstat (limited to 'src/afl-common.c')
-rw-r--r-- | src/afl-common.c | 5 |
1 files changed, 5 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); |