◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
8 changes: 2 additions & 6 deletions fuzzing/fuzz-targets/fuzz_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ def TestOneInput(data):
git_config.read()
except (MissingSectionHeaderError, ParsingError, UnicodeDecodeError):
return -1 # Reject inputs raising expected exceptions
except (IndexError, ValueError) as e:
if isinstance(e, IndexError) and "string index out of range" in str(e):
# Known possibility that might be patched
# See: https://github.com/gitpython-developers/GitPython/issues/1887
pass
elif isinstance(e, ValueError) and "embedded null byte" in str(e):
# The `os.path.expanduser` function, which does not accept strings
# containing null bytes might raise this.
return -1
Expand Down
2 changes: 1 addition & 1 deletion git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def _read(self, fp: Union[BufferedReader, IO[bytes]], fpname: str) -> None:
e = None # None, or an exception.

def string_decode(v: str) -> str:
if v[-1] == "\\":
v = v[:-1]
# END cut trailing escapes to prevent decode error

Expand Down
Toggle all file notes Toggle all file annotations