diff options
author | van Hauser <vh@thc.org> | 2022-12-20 14:31:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 14:31:09 +0100 |
commit | 60dc37a8cf09f8e9048e4b6a2204d6c90b27655a (patch) | |
tree | ab66c723be9ccadde42329cc85de1c141f8bddcd /utils | |
parent | 8cdc48f73a17ddd557897f2098937a8ba3bfe184 (diff) | |
parent | 0165ca8c6c485e36fe8e5fc6182ebeba2100932b (diff) | |
download | afl++-60dc37a8cf09f8e9048e4b6a2204d6c90b27655a.tar.gz |
Merge pull request #1592 from AFLplusplus/dev
Dev
Diffstat (limited to 'utils')
-rw-r--r-- | utils/argv_fuzzing/argv-fuzz-inl.h | 6 | ||||
-rw-r--r-- | utils/libtokencap/README.md | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/utils/argv_fuzzing/argv-fuzz-inl.h b/utils/argv_fuzzing/argv-fuzz-inl.h index c15c0271..ec22c53b 100644 --- a/utils/argv_fuzzing/argv-fuzz-inl.h +++ b/utils/argv_fuzzing/argv-fuzz-inl.h @@ -34,6 +34,7 @@ #ifndef _HAVE_ARGV_FUZZ_INL #define _HAVE_ARGV_FUZZ_INL +#include <stdlib.h> #include <unistd.h> #define AFL_INIT_ARGV() \ @@ -63,7 +64,10 @@ static char **afl_init_argv(int *argc) { char *ptr = in_buf; int rc = 0; - if (read(0, in_buf, MAX_CMDLINE_LEN - 2) < 0) {} + ssize_t num = read(0, in_buf, MAX_CMDLINE_LEN - 2); + if (num < 1) { _exit(1); } + in_buf[num] = '\0'; + in_buf[num + 1] = '\0'; while (*ptr && rc < MAX_CMDLINE_PAR) { diff --git a/utils/libtokencap/README.md b/utils/libtokencap/README.md index 50104291..8705452c 100644 --- a/utils/libtokencap/README.md +++ b/utils/libtokencap/README.md @@ -47,9 +47,11 @@ by AFL++ in that earlier run. This demonstrates the basic principle: ``` export AFL_TOKEN_FILE=$PWD/temp_output.txt + timeout_sec="5" for i in <out_dir>/queue/id*; do LD_PRELOAD=/path/to/libtokencap.so \ + timeout -s SIGKILL ${timeout_sec} \ /path/to/target/program [...params, including $i...] done |