Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions decode.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import encodings
import pkgutil

ALL_CODECS = sorted(
name
for _, name, _ in pkgutil.iter_modules(encodings.__path__)
if not name.startswith("_") and name != "aliases"
)


def FuzzerRunOne(FuzzerInput):
half = int(len(FuzzerInput) / 2)
A = FuzzerInput[:half]
B = FuzzerInput[half:].decode("utf-8", "replace").strip()
if len(FuzzerInput) < 2:
return
codec = ALL_CODECS[FuzzerInput[0] % len(ALL_CODECS)]
data = FuzzerInput[1:]
try:
A.decode(B)
data.decode(codec)
except SystemError:
raise
except:
except Exception:
pass
324 changes: 0 additions & 324 deletions fuzzer-decode.dict

This file was deleted.