hyper-h2: catch IndexError as well

This commit is contained in:
Maximilian Hils 2021-09-16 11:41:52 +02:00 committed by GitHub
parent b41416b729
commit cf32b18d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,7 +139,7 @@ class Http2Connection(HttpConnection):
try: try:
try: try:
events = self.h2_conn.receive_data(event.data) events = self.h2_conn.receive_data(event.data)
except ValueError as e: # pragma: no cover except (ValueError, IndexError) as e: # pragma: no cover
# this should never raise a ValueError, but we triggered one while fuzzing: # this should never raise a ValueError, but we triggered one while fuzzing:
# https://github.com/python-hyper/hyper-h2/issues/1231 # https://github.com/python-hyper/hyper-h2/issues/1231
# this stays here as defense-in-depth. # this stays here as defense-in-depth.