diff --git a/experiment/measurer/coverage_utils.py b/experiment/measurer/coverage_utils.py index 42ca57385..27ab69965 100644 --- a/experiment/measurer/coverage_utils.py +++ b/experiment/measurer/coverage_utils.py @@ -276,6 +276,8 @@ def generate_json_summary(coverage_binary, if summary_only: command.append('-summary-only') + # Ensure the directory exists, creating it if necessary + os.makedirs(os.path.dirname(output_file), exist_ok=True) with open(output_file, 'w', encoding='utf-8') as dst_file: result = new_process.execute(command, diff --git a/experiment/runner.py b/experiment/runner.py index b955ff665..b8c95fcca 100644 --- a/experiment/runner.py +++ b/experiment/runner.py @@ -95,6 +95,8 @@ def _clean_seed_corpus(seed_corpus_dir): def get_clusterfuzz_seed_corpus_path(fuzz_target_path): """Returns the path of the clusterfuzz seed corpus archive if one exists. Otherwise returns None.""" + if not fuzz_target_path: + return None fuzz_target_without_extension = os.path.splitext(fuzz_target_path)[0] seed_corpus_path = (fuzz_target_without_extension + SEED_CORPUS_ARCHIVE_SUFFIX)