mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
fix h2 bug found via fuzzing
This commit is contained in:
parent
76f0b8f65e
commit
fb625c6868
@ -65,6 +65,8 @@ class Http2Connection(HttpConnection):
|
|||||||
stream is not None
|
stream is not None
|
||||||
and
|
and
|
||||||
stream.state_machine.state is not h2.stream.StreamState.CLOSED
|
stream.state_machine.state is not h2.stream.StreamState.CLOSED
|
||||||
|
and
|
||||||
|
self.h2_conn.state_machine.state is not h2.connection.ConnectionState.CLOSED
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
@ -79,6 +81,8 @@ class Http2Connection(HttpConnection):
|
|||||||
stream.state_machine.state is not h2.stream.StreamState.HALF_CLOSED_LOCAL
|
stream.state_machine.state is not h2.stream.StreamState.HALF_CLOSED_LOCAL
|
||||||
and
|
and
|
||||||
stream.state_machine.state is not h2.stream.StreamState.CLOSED
|
stream.state_machine.state is not h2.stream.StreamState.CLOSED
|
||||||
|
and
|
||||||
|
self.h2_conn.state_machine.state is not h2.connection.ConnectionState.CLOSED
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -236,6 +236,7 @@ def _h2_request(chunks):
|
|||||||
@example([
|
@example([
|
||||||
b'\x00\x00%\x01\x04\x00\x00\x00\x01A\x8b/\x91\xd3]\x05\\\x87\xa6\xe3M3\x84\x86\x82`\x85\x94\xe7\x8c~\xfff\x88/\x91'
|
b'\x00\x00%\x01\x04\x00\x00\x00\x01A\x8b/\x91\xd3]\x05\\\x87\xa6\xe3M3\x84\x86\x82`\x85\x94\xe7\x8c~\xfff\x88/\x91'
|
||||||
b'\xd3]\x05\\\x87\xa7\\\x82h_\x00\x00\x07\x01\x05\x00\x00\x00\x01\xc1\x84\x86\x82\xc0\xbf\xbe'])
|
b'\xd3]\x05\\\x87\xa7\\\x82h_\x00\x00\x07\x01\x05\x00\x00\x00\x01\xc1\x84\x86\x82\xc0\xbf\xbe'])
|
||||||
|
@example([b'\x00\x00\x03\x01\x04\x00\x00\x00\x01\x84\x86\x82\x00\x00\x08\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'])
|
||||||
def test_fuzz_h2_request_chunks(chunks):
|
def test_fuzz_h2_request_chunks(chunks):
|
||||||
_h2_request(chunks)
|
_h2_request(chunks)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user