diff options
author | vanhauser-thc <vh@thc.org> | 2023-07-08 13:31:06 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2023-07-08 13:31:06 +0200 |
commit | 20dcb40c53811e36a3ace91a66a70cfddc4b3f1c (patch) | |
tree | 5a2ad0c8e5692bbc64f81ec06dc5b71a980ee554 | |
parent | d30272a64e5220e02c9c1cf69925825494a99e80 (diff) | |
download | afl++-20dcb40c53811e36a3ace91a66a70cfddc4b3f1c.tar.gz |
fix cmin -T
-rwxr-xr-x | afl-cmin | 5 | ||||
-rwxr-xr-x | afl-cmin.bash | 7 | ||||
-rw-r--r-- | docs/Changelog.md | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/afl-cmin b/afl-cmin index d0bbed2b..f3ae4304 100755 --- a/afl-cmin +++ b/afl-cmin @@ -493,6 +493,11 @@ BEGIN { } } + if (in_count < threads) { + threads = in_count + print "[!] WARNING: less inputs than threads, reducing threads to "threads" and likely the overhead of threading makes things slower..." + } + # Let's roll! ############################# diff --git a/afl-cmin.bash b/afl-cmin.bash index 1d080491..b326bee8 100755 --- a/afl-cmin.bash +++ b/afl-cmin.bash @@ -339,6 +339,13 @@ fi echo "[*] Are you aware that afl-cmin is faster than this afl-cmin.bash script?" echo "[+] Found $IN_COUNT files for minimizing." +if [ -n "$THREADS" ]; then + if [ "$IN_COUNT" -lt "$THREADS" ]; then + THREADS=$IN_COUNT + echo "[!] WARNING: less inputs than threads, reducing threads to $THREADS and likely the overhead of threading makes things slower..." + fi +fi + FIRST_FILE=`ls "$IN_DIR" | head -1` # Make sure that we're not dealing with a directory. diff --git a/docs/Changelog.md b/docs/Changelog.md index ad58e99e..032bb774 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -19,6 +19,7 @@ - fixed a bug inherited from vanilla AFL where a coverage of map[123] = 11 would be the same as map[1123] = 1 - warn on crashing inputs + - adjust threads if less inputs than threads specified - afl-cc: - fixed an off-by-one instrumentation of iselect, hurting coverage a bit. Thanks to @amykweon for spotting and fixing! |