]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
oss-fuzz: include generated corpora in the final zip file
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 7 Jan 2023 09:27:05 +0000 (10:27 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 7 Jan 2023 16:44:23 +0000 (17:44 +0100)
Since the files with generated directives are now automatically
generated during build, they're now under the respective build directory
which the current oss-fuzz CI script didn't account for.

Follow-up to: #24958
Resolves: #25859

tools/oss-fuzz.sh

index 793411ed845de4da3906a802757c35eb9136aa89..7e9312b833470cc56b863a60158516063d888344 100755 (executable)
@@ -97,7 +97,10 @@ rm -rf "$hosts"
 # The seed corpus is a separate flat archive for each fuzzer,
 # with a fixed name ${fuzzer}_seed_corpus.zip.
 for d in test/fuzz/fuzz-*; do
-    zip -jqr "$OUT/$(basename "$d")_seed_corpus.zip" "$d"
+    fuzzer="$(basename "$d")"
+    # Include the build-generated corpora if any as well
+    readarray -t generated < <(find "$build/test/fuzz" -maxdepth 1 -name "${fuzzer}*" -type f)
+    zip -jqr "$OUT/${fuzzer}_seed_corpus.zip" "$d" "${generated[@]}"
 done
 
 # get fuzz-dns-packet corpus