summaryrefslogtreecommitdiff
path: root/tools/oss-fuzz.sh
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2021-09-29 21:28:55 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2021-09-30 12:27:06 +0200
commitf7e0d22d76ead994a848049fb45afd9a6fb9915a (patch)
tree5875e694923192d7c7a9d1b89fb18dba6a9ca22a /tools/oss-fuzz.sh
parent1c3f490f230c1dad83901b1768456082159f2cbe (diff)
downloadsystemd-f7e0d22d76ead994a848049fb45afd9a6fb9915a.tar.gz
tools: shellcheck-ify tool scripts
Diffstat (limited to 'tools/oss-fuzz.sh')
-rwxr-xr-xtools/oss-fuzz.sh32
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh
index 767da15f7c..d9cfcf8f3b 100755
--- a/tools/oss-fuzz.sh
+++ b/tools/oss-fuzz.sh
@@ -21,11 +21,11 @@ export LDFLAGS=${LDFLAGS:--L${clang_lib}}
export WORK=${WORK:-$(pwd)}
export OUT=${OUT:-$(pwd)/out}
-mkdir -p $OUT
+mkdir -p "$OUT"
-build=$WORK/build
-rm -rf $build
-mkdir -p $build
+build="$WORK/build"
+rm -rf "$build"
+mkdir -p "$build"
if [ -z "$FUZZING_ENGINE" ]; then
fuzzflag="llvm-fuzz=true"
@@ -38,28 +38,28 @@ else
fi
fi
-if ! meson $build -D$fuzzflag -Db_lundef=false; then
- cat $build/meson-logs/meson-log.txt
+if ! meson "$build" "-D$fuzzflag" -Db_lundef=false; then
+ cat "$build/meson-logs/meson-log.txt"
exit 1
fi
-ninja -v -C $build fuzzers
+ninja -v -C "$build" fuzzers
# The seed corpus is a separate flat archive for each fuzzer,
# with a fixed name ${fuzzer}_seed_corpus.zip.
for d in "$(dirname "$0")/../test/fuzz/fuzz-"*; do
- zip -jqr $OUT/$(basename "$d")_seed_corpus.zip "$d"
+ zip -jqr "$OUT/$(basename "$d")_seed_corpus.zip" "$d"
done
# get fuzz-dns-packet corpus
-df=$build/dns-fuzzing
-git clone --depth 1 https://github.com/CZ-NIC/dns-fuzzing $df
-zip -jqr $OUT/fuzz-dns-packet_seed_corpus.zip $df/packet
+df="$build/dns-fuzzing"
+git clone --depth 1 https://github.com/CZ-NIC/dns-fuzzing "$df"
+zip -jqr "$OUT/fuzz-dns-packet_seed_corpus.zip" "$df/packet"
-install -Dt $OUT/src/shared/ $build/src/shared/libsystemd-shared-*.so
+install -Dt "$OUT/src/shared/" "$build"/src/shared/libsystemd-shared-*.so
-wget -O $OUT/fuzz-json.dict https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/json.dict
+wget -O "$OUT/fuzz-json.dict" https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/json.dict
-find $build -maxdepth 1 -type f -executable -name "fuzz-*" -exec mv {} $OUT \;
-find src -type f -name "fuzz-*.dict" -exec cp {} $OUT \;
-cp src/fuzz/*.options $OUT
+find "$build" -maxdepth 1 -type f -executable -name "fuzz-*" -exec mv {} "$OUT" \;
+find src -type f -name "fuzz-*.dict" -exec cp {} "$OUT" \;
+cp src/fuzz/*.options "$OUT"