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

Tidy up, and add harness for examples #27

Merged
merged 4 commits into from Jan 13, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Fix the zipfile example for Python 2; and rename it.

The examples/csv/fuzz.py is actually testing the zipfile module,
so it has been renamed to reflect this. There are slight differences
in the Python 2 usage, which I've harmonised in the module.
  • Loading branch information
gerph committed Jan 11, 2020
commit fedb3052717fd5b8f7429df9968d99f1d39fa6c0

This file was deleted.

@@ -0,0 +1,23 @@
import io
import zipfile
from pythonfuzz.main import PythonFuzz

try:
allowed_exceptions = (zipfile.BadZipFile, zipfile.LargeZipFile)
except AttributeError:
# In Python2, one of these had an inconsistent capitalisation
allowed_exceptions = (zipfile.BadZipfile, zipfile.LargeZipFile)


@PythonFuzz
def fuzz(buf):
f = io.BytesIO(buf)
try:
z = zipfile.ZipFile(f)
z.testzip()
except :
pass


if __name__ == '__main__':
fuzz()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.