Commit 7b684cd
committed
Add graceful handling of expected exceptions in
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.fuzz_submodule.py
1 parent 2345c1a commit 7b684cdCopy 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
- fuzzing/fuzz-targets
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 number | Diff line number | Diff line change |
|---|---|---|
| ||
67 | 67 | |
68 | 68 | |
69 | 69 | |
70 | | - |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
71 | 79 | |
72 | 80 | |
73 | 81 | |
|
0 commit comments