mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-31 07:18:58 +00:00
Fix http_protocol parsing crash discovered with pathoc fuzzing.
This commit is contained in:
parent
619f3c6edc
commit
ed64b0e796
@ -141,10 +141,10 @@ def parse_http_protocol(s):
|
||||
"""
|
||||
if not s.startswith("HTTP/"):
|
||||
return None
|
||||
_, version = s.split('/')
|
||||
_, version = s.split('/', 1)
|
||||
if "." not in version:
|
||||
return None
|
||||
major, minor = version.split('.')
|
||||
major, minor = version.split('.', 1)
|
||||
try:
|
||||
major = int(major)
|
||||
minor = int(minor)
|
||||
|
Loading…
Reference in New Issue
Block a user