Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b684cd

Browse filesBrowse files
committed
Add graceful handling of expected exceptions in fuzz_submodule.py
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69350 **`IsADirectoryError`** Fuzzer provided input data can sometimes produce filenames that look like directories and raise `IsADirectoryError` exceptions which crash the fuzzer. This commit catches those cases and returns -1 to instruct libfuzzer that the inputs are not valuable to add to the corpus. **`FileExistsError`** Similar to the above, this is a possible exception case produced by the fuzzed data and not a bug so its handled the same.
1 parent 2345c1a commit 7b684cd
Copy full SHA for 7b684cd

1 file changed

+9-1Lines changed: 9 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎fuzzing/fuzz-targets/fuzz_submodule.py‎

Copy file name to clipboardExpand all lines: fuzzing/fuzz-targets/fuzz_submodule.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ def TestOneInput(data):
6767
)
6868
repo.index.commit(f"Removed submodule {submodule_name}")
6969

70-
except (ParsingError, GitCommandError, InvalidGitRepositoryError, FileNotFoundError, BrokenPipeError):
70+
except (
71+
ParsingError,
72+
GitCommandError,
73+
InvalidGitRepositoryError,
74+
FileNotFoundError,
75+
FileExistsError,
76+
IsADirectoryError,
77+
BrokenPipeError,
78+
):
7179
return -1
7280
except (ValueError, OSError) as e:
7381
expected_messages = [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.