Skip to content

IndexError: tuple index out of range #67

@DRMacIver

Description

@DRMacIver

The following string raises the titular exception when run chardet.detect is run on it using 9e419e9

b'\xfe\xcf'

Here's the full stack trace:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/david/crap/chardet/chardet/__init__.py", line 30, in detect
    u.feed(byte_str)
  File "/home/david/crap/chardet/chardet/universaldetector.py", line 189, in feed
    if prober.feed(byte_str) == ProbingState.found_it:
  File "/home/david/crap/chardet/chardet/charsetgroupprober.py", line 63, in feed
    state = prober.feed(byte_str)
  File "/home/david/crap/chardet/chardet/mbcharsetprober.py", line 75, in feed
    char_len)
  File "/home/david/crap/chardet/chardet/chardistribution.py", line 82, in feed
    if 512 > self._char_to_freq_order[order]:
IndexError: tuple index out of range

This one doesn't actually come from Hypothesis but from a fuzzing experiment I was running which it occurred to me would be applicable to chardet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions