* Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

* Quote the parameter to -name so the shell won't interpret it.
This commit is contained in:
Robin Richtsfeld 2018-04-30 19:38:48 +02:00 committed by Abhishek Arya
parent 527ef4c7f0
commit 71d91515be
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ if [[ "$FUZZING_ENGINE" = afl ]]; then
export AFL_SKIP_CPUFREQ=1
# AFL expects at least 1 file in the input dir.
echo input > ${CORPUS_DIR}/input
CMD_LINE="$OUT/afl-fuzz $AFL_FUZZER_ARGS -i $CORPUS_DIR -o $FUZZER_OUT $@ $OUT/$FUZZER"
CMD_LINE="$OUT/afl-fuzz $AFL_FUZZER_ARGS -i $CORPUS_DIR -o $FUZZER_OUT $* $OUT/$FUZZER"
elif [[ "$FUZZING_ENGINE" = honggfuzz ]]; then
# Honggfuzz expects at least 1 file in the input dir.
echo input > $CORPUS_DIR/input
@ -57,9 +57,9 @@ elif [[ "$FUZZING_ENGINE" = honggfuzz ]]; then
# -P: use persistent mode of fuzzing (i.e. LLVMFuzzerTestOneInput)
# -f: location of the initial (and destination) file corpus
# -n: number of fuzzing threads (and processes)
CMD_LINE="$OUT/honggfuzz -n 1 --exit_upon_crash -R /tmp/${FUZZER}_honggfuzz.report -W $FUZZER_OUT -v -z -P -f \"$CORPUS_DIR\" $@ -- \"$OUT/$FUZZER\""
CMD_LINE="$OUT/honggfuzz -n 1 --exit_upon_crash -R /tmp/${FUZZER}_honggfuzz.report -W $FUZZER_OUT -v -z -P -f \"$CORPUS_DIR\" $* -- \"$OUT/$FUZZER\""
else
CMD_LINE="$OUT/$FUZZER $FUZZER_ARGS $@ $CORPUS_DIR"
CMD_LINE="$OUT/$FUZZER $FUZZER_ARGS $* $CORPUS_DIR"
OPTIONS_FILE="${FUZZER}.options"
if [ -f $OPTIONS_FILE ]; then

View File

@ -21,7 +21,7 @@
make -j$(nproc)
fuzzers=$(find fuzz -maxdepth 1 -executable -type f -name \fuzz_*)
fuzzers=$(find fuzz -maxdepth 1 -executable -type f -name 'fuzz_*')
for f in $fuzzers; do
fuzzer=$(basename $f)
cp $f $OUT/