Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid oss-fuzz corpus download url #1895

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmarks/php_php-fuzz-parser_0dbedb/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ commit_date: 2022-07-15T10:03:12+0000
fuzz_target: php-fuzz-parser
project: php
type: bug
oss_fuzz_corpus_target: php_php-fuzz-parser
unsupported_fuzzers:
- aflcc
- afl_qemu
Expand Down
1 change: 1 addition & 0 deletions benchmarks/stb_stbi_read_fuzzer/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ commit: 5736b15f7ea0ffb08dd38af21067c314d6a3aae9
commit_date: 2023-01-29T18:46:04+00:00
fuzz_target: stbi_read_fuzzer
project: stb
oss_fuzz_corpus_target: stb_stbi_read_fuzzer
unsupported_fuzzers:
- aflcc
- afl_qemu
Expand Down
5 changes: 5 additions & 0 deletions common/benchmark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def get_project(benchmark):
return benchmark_config.get_config(benchmark)['project']


def get_oss_fuzz_corpus_target(benchmark):
"""Returns oss-fuzz corpus fuzz target of |benchmark|"""
return benchmark_config.get_config(benchmark).get('oss_fuzz_corpus_target')


def get_type(benchmark):
"""Returns the type of |benchmark|"""
# TODO(metzman): Use classes to mock a benchmark config for
Expand Down
6 changes: 5 additions & 1 deletion experiment/run_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,12 @@ def add_oss_fuzz_corpus(benchmark, oss_fuzz_corpora_dir):
fuzz targets."""
project = benchmark_utils.get_project(benchmark)
fuzz_target = benchmark_utils.get_fuzz_target(benchmark)
oss_fuzz_corpus_target = benchmark_utils.get_oss_fuzz_corpus_target(
benchmark)

if not fuzz_target.startswith(project):
if oss_fuzz_corpus_target:
full_fuzz_target = oss_fuzz_corpus_target
elif not fuzz_target.startswith(project):
full_fuzz_target = f'{project}_{fuzz_target}'
else:
full_fuzz_target = fuzz_target
Expand Down
Loading