From 0560985d20c08fe967fdf7a2d78799d8be2c76c9 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Thu, 13 Jul 2023 09:44:28 -0400 Subject: [PATCH] fuzz: add all fuzzers to OSS-fuzz I forgot to do this step, and as a result, OSS-fuzz hasn't been running any of the new fuzzers. Hopefully this is enough. Ref #1037 --- fuzz/Cargo.toml | 3 +++ fuzz/oss-fuzz-build.sh | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 8688e73e0..a7eec2c81 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -32,6 +32,9 @@ features = ["atty", "humantime", "termcolor"] [workspace] members = ["."] +# NOTE: If you add a new fuzzer below, please make sure to add it to the +# oss-fuzz-build.sh script, otherwise it won't get run in OSS-fuzz. + [[bin]] name = "fuzz_regex_match" path = "fuzz_targets/fuzz_regex_match.rs" diff --git a/fuzz/oss-fuzz-build.sh b/fuzz/oss-fuzz-build.sh index 38750250b..f96474739 100755 --- a/fuzz/oss-fuzz-build.sh +++ b/fuzz/oss-fuzz-build.sh @@ -1,4 +1,18 @@ #!/bin/bash -eu + cd $SRC/regex -cargo fuzz build -O --debug-assertions -cp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_regex_match $OUT/ +cargo fuzz build -O --debug-assertions + +targets=( + fuzz_regex_match + fuzz_regex_lite_match + fuzz_regex_automata_deserialize_dense_dfa + fuzz_regex_automata_deserialize_sparse_dfa + ast_roundtrip + ast_fuzz_match + ast_fuzz_regex + ast_fuzz_match_bytes +) +for target in "${targets[@]}"; do + cp fuzz/target/x86_64-unknown-linux-gnu/release/$target $OUT/ +done