Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected IndexError #23

Closed
Lukasa opened this issue Feb 1, 2016 · 0 comments
Closed

Unexpected IndexError #23

Lukasa opened this issue Feb 1, 2016 · 0 comments

Comments

@Lukasa
Copy link
Member

Lukasa commented Feb 1, 2016

Encountered the following traceback while fuzzing hyper-h2:

Traceback (most recent call last):
  File "script.py", line 10, in <module>
    c.receive_data(sys.stdin.read())
  File "/Users/cory/tmp/fuzz-results/env/lib/python2.7/site-packages/h2/connection.py", line 892, in receive_data
    events.extend(self._receive_frame(frame))
  File "/Users/cory/tmp/fuzz-results/env/lib/python2.7/site-packages/h2/connection.py", line 915, in _receive_frame
    frames, events = self._frame_dispatch_table[frame.__class__](frame)
  File "/Users/cory/tmp/fuzz-results/env/lib/python2.7/site-packages/h2/connection.py", line 956, in _receive_headers_frame
    headers = self.decoder.decode(frame.data)
  File "/Users/cory/tmp/fuzz-results/env/lib/python2.7/site-packages/hpack/hpack.py", line 334, in decode
    data[current_index:]
  File "/Users/cory/tmp/fuzz-results/env/lib/python2.7/site-packages/hpack/hpack.py", line 375, in _decode_literal_index
    return self._decode_literal(data, True)
  File "/Users/cory/tmp/fuzz-results/env/lib/python2.7/site-packages/hpack/hpack.py", line 416, in _decode_literal
    length, consumed = decode_integer(data, 7)
  File "/Users/cory/tmp/fuzz-results/env/lib/python2.7/site-packages/hpack/hpack.py", line 60, in decode_integer
    number = to_byte(data[index]) & mask
IndexError: string index out of range

It would be good if this threw a hpack-specific exception instead of IndexError.

@Lukasa Lukasa added the bug label Feb 1, 2016
@Lukasa Lukasa changed the title IndexError Unexpected IndexError Feb 1, 2016
Lukasa added a commit that referenced this issue Feb 1, 2016
@Lukasa Lukasa closed this as completed in #26 Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant