diff options
author | van Hauser <vh@thc.org> | 2020-08-12 14:29:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 14:29:34 +0200 |
commit | 8044ae28be2dd109ac16719ce2e304074fa74efd (patch) | |
tree | dedf9bafaf8d176bc07912a2f512187af9048f36 /src/afl-fuzz.c | |
parent | 986af28df27016813abdfdde8bdedda1f571703c (diff) | |
parent | b38837f4ff8f2e52597b7908b9226500e5c61933 (diff) | |
download | afl++-8044ae28be2dd109ac16719ce2e304074fa74efd.tar.gz |
Merge pull request #496 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz.c')
-rw-r--r-- | src/afl-fuzz.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index da30797c..5dd092f2 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -79,7 +79,7 @@ static void at_exit() { /* Display usage hints. */ -static void usage(afl_state_t *afl, u8 *argv0, int more_help) { +static void usage(u8 *argv0, int more_help) { SAYF( "\n%s [ options ] -- /path/to/fuzzed_app [ ... ]\n\n" @@ -115,8 +115,8 @@ static void usage(afl_state_t *afl, u8 *argv0, int more_help) { " if using QEMU, just use -c 0.\n\n" "Fuzzing behavior settings:\n" - " -N - do not unlink the fuzzing input file (only for " - "devices etc.!)\n" + " -N - do not unlink the fuzzing input file (for devices " + "etc.)\n" " -d - quick & dirty mode (skips deterministic steps)\n" " -n - fuzz without instrumentation (non-instrumented mode)\n" " -x dict_file - optional fuzzer dictionary (see README.md, its really " @@ -289,9 +289,12 @@ int main(int argc, char **argv_orig, char **envp) { if (afl->cpu_to_bind != -1) FATAL("Multiple -b options not supported"); - if (sscanf(optarg, "%u", &afl->cpu_to_bind) < 0 || optarg[0] == '-') + if (sscanf(optarg, "%d", &afl->cpu_to_bind) < 0) { + FATAL("Bad syntax used for -b"); + } + break; } @@ -677,7 +680,7 @@ int main(int argc, char **argv_orig, char **envp) { u64 limit_time_puppet2 = afl->limit_time_puppet * 60 * 1000; - if (limit_time_puppet2 < afl->limit_time_puppet) { + if ((s32)limit_time_puppet2 < afl->limit_time_puppet) { FATAL("limit_time overflow"); @@ -811,7 +814,7 @@ int main(int argc, char **argv_orig, char **envp) { if (optind == argc || !afl->in_dir || !afl->out_dir || show_help) { - usage(afl, argv[0], show_help); + usage(argv[0], show_help); } |