Skip to content

Commit

Permalink
Fuzzing: Gracefully Handle Uninteresting Error to Fix OSS-Fuzz Issue …
Browse files Browse the repository at this point in the history
…71095

Fuzzing data can generate filenames that trigger:
> OSError: [Errno 36] File name too long

The changes here add handling for these exceptions because they di not
indicate a bug and should not crash the fuzzer.
a
  • Loading branch information
DaveLak committed Aug 13, 2024
1 parent e57cc2c commit 7126ce1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fuzzing/fuzz-targets/fuzz_submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def TestOneInput(data):
except Exception as e:
if isinstance(e, ValueError) and "embedded null byte" in str(e):
return -1
elif isinstance(e, OSError) and "File name too long" in str(e):
return -1
else:
return handle_exception(e)

Expand Down

0 comments on commit 7126ce1

Please sign in to comment.