summaryrefslogtreecommitdiffstats
path: root/tools/oss-fuzzshark
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /tools/oss-fuzzshark
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/oss-fuzzshark')
-rwxr-xr-xtools/oss-fuzzshark/build.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/oss-fuzzshark/build.sh b/tools/oss-fuzzshark/build.sh
new file mode 100755
index 00000000..bc86cdc0
--- /dev/null
+++ b/tools/oss-fuzzshark/build.sh
@@ -0,0 +1,22 @@
+#!/bin/bash -eux
+# Copyright 2017 Google Inc.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# TODO: support specifing targets in args. Google oss-fuzz specifies 'all'.
+
+# TODO update oss-fuzz configuration to build with OSS_FUZZ=1? This is necessary
+# to build the fuzzshark_* targets for oss-fuzz.
+cmake -DOSS_FUZZ=1 .
+
+cmake --build . --target all-fuzzers
+
+for file in run/fuzzshark_*; do
+ fuzzer_name="${file##*/}"
+ fuzzer_target="${fuzzer_name#fuzzshark_}"
+ mv "$file" "$OUT/"
+ echo -en "[libfuzzer]\nmax_len = 1024\n" > $OUT/${fuzzer_name}.options
+ if [ -d "$SAMPLES_DIR/${fuzzer_target}" ]; then
+ zip -j $OUT/${fuzzer_name}_seed_corpus.zip $SAMPLES_DIR/${fuzzer_target}/*/*.bin
+ fi
+done