Skip to content

Commit

Permalink
fix: invalid oss-fuzz corpus download url
Browse files Browse the repository at this point in the history
  • Loading branch information
jiradeto committed Sep 5, 2023
1 parent ff8ef0c commit 308039e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
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
2 changes: 2 additions & 0 deletions common/benchmark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def get_project(benchmark):
"""Returns the project of |benchmark|"""
return benchmark_config.get_config(benchmark)['project']

def get_oss_fuzz_corpus_target(benchmark):
return benchmark_config.get_config(benchmark).get('oss_fuzz_corpus_target')

def get_type(benchmark):
"""Returns the type of |benchmark|"""
Expand Down
7 changes: 5 additions & 2 deletions experiment/run_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,11 @@ 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)

if not fuzz_target.startswith(project):
oss_fuzz_corpus_target = benchmark_utils.get_oss_fuzz_corpus_target(benchmark)

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

0 comments on commit 308039e

Please sign in to comment.