]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - tools/oss-fuzz.sh
logind: when we cannot attach a passed fd to a device, close it
[thirdparty/systemd.git] / tools / oss-fuzz.sh
index 7cc7df5106db67ce49c3633eb4b32e57b9d8cd38..9a116be114243a7e1d4f14537de643438d8cc5d6 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 # SPDX-License-Identifier: LGPL-2.1+
-#
-# Copyright 2017 Jonathan Rudenberg
 
 set -ex
 
@@ -37,8 +35,10 @@ fi
 meson $build -D$fuzzflag -Db_lundef=false
 ninja -C $build fuzzers
 
-for d in "$(dirname "$0")/../test/fuzz-corpus/"*; do
-        zip -jqr $OUT/fuzz-$(basename "$d")_seed_corpus.zip "$d"
+# 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"
 done
 
 # get fuzz-dns-packet corpus
@@ -46,8 +46,11 @@ 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 the private shared library without executable permissions
-install -Dt $OUT/src/shared/ -m 0644 $build/src/shared/libsystemd-shared-*.so
+install -Dt $OUT/src/shared/ $build/src/shared/libsystemd-shared-*.so
+
+wget -O $OUT/fuzz-json_seed_corpus.zip https://storage.googleapis.com/skia-fuzzer/oss-fuzz/skjson_seed_corpus.zip
+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