Skip to content

Commit 5216c4f

Browse files
core: frontend: cpp: check source file exists before reading (#1911)
Signed-off-by: David Korczynski <[email protected]>
1 parent 40da5bf commit 5216c4f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/fuzz_introspector/frontends/frontend_cpp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ def load_treesitter_trees(source_files, log_harnesses=True):
371371
for language in source_files:
372372
if language == 'cpp':
373373
for code_file in source_files[language]:
374+
if not os.path.isfile(code_file):
375+
continue
374376
source_cls = SourceCodeFile(code_file, language)
375377
if log_harnesses:
376378
if source_cls.has_libfuzzer_harness():

src/fuzz_introspector/frontends/oss_fuzz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def process_jvm_project(target_dir, entrypoint, out):
175175
def analyse_folder(language, directory, entrypoint, out=''):
176176
if language == 'c':
177177
process_c_project(directory, entrypoint, out)
178-
if language == 'cpp':
178+
if language.lower() in ['cpp', 'c++']:
179179
process_cpp_project(directory, entrypoint, out)
180180
if language == 'go':
181181
process_go_project(directory, out)

0 commit comments

Comments
 (0)