This commit is contained in:
vanhauser-thc
2023-04-25 11:56:50 +02:00
parent 7b877e2c1d
commit bc969f78f6
2 changed files with 11 additions and 5 deletions

View File

@ -316,12 +316,16 @@ if [ ! "$T_ARG" = "" ]; then
if [ "$T_ARG" = "all" ]; then if [ "$T_ARG" = "all" ]; then
THREADS=$(nproc) THREADS=$(nproc)
else else
if [ "$T_ARG" -gt 0 -a "$T_ARG" -le "$(nproc)" ]; then if [ "$T_ARG" -gt 1 -a "$T_ARG" -le "$(nproc)" ]; then
THREADS=$T_ARG THREADS=$T_ARG
else else
echo "[-] Error: -T parameter must between 1 and $(nproc) or \"all\"." 1>&2 echo "[-] Error: -T parameter must between 2 and $(nproc) or \"all\"." 1>&2
fi fi
fi fi
else
if [ "$F_ARG" = ""]; then
echo "[*] Are you aware of the '-T all' parallelize option that massively improves the speed?"
fi
fi fi
IN_COUNT=$((`ls -- "$IN_DIR" 2>/dev/null | wc -l`)) IN_COUNT=$((`ls -- "$IN_DIR" 2>/dev/null | wc -l`))
@ -332,6 +336,7 @@ if [ "$IN_COUNT" = "0" ]; then
exit 1 exit 1
fi fi
echo "[*] Are you aware that afl-cmin is faster than this afl-cmin.bash script?"
echo "[+] Found $IN_COUNT files for minimizing." echo "[+] Found $IN_COUNT files for minimizing."
FIRST_FILE=`ls "$IN_DIR" | head -1` FIRST_FILE=`ls "$IN_DIR" | head -1`

View File

@ -756,7 +756,7 @@ void read_testcases(afl_state_t *afl, u8 *directory) {
free(nl[i]); /* not tracked */ free(nl[i]); /* not tracked */
read_testcases(afl, fn2); read_testcases(afl, fn2);
ck_free(fn2); ck_free(fn2);
continue; goto next_entry;
} }
@ -765,7 +765,7 @@ void read_testcases(afl_state_t *afl, u8 *directory) {
if (!S_ISREG(st.st_mode) || !st.st_size || strstr(fn2, "/README.txt")) { if (!S_ISREG(st.st_mode) || !st.st_size || strstr(fn2, "/README.txt")) {
ck_free(fn2); ck_free(fn2);
continue; goto next_entry;
} }
@ -812,13 +812,14 @@ void read_testcases(afl_state_t *afl, u8 *directory) {
} }
next_entry:
if (unlikely(afl->in_place_resume)) { if (unlikely(afl->in_place_resume)) {
if (unlikely(i == 0)) { done = 1; } if (unlikely(i == 0)) { done = 1; }
} else { } else {
if (unlikely(++i == (u32)nl_cnt)) { done = 1; } if (unlikely(++i >= (u32)nl_cnt)) { done = 1; }
} }