Skip to content

Commit

Permalink
Added a fuzzer for integration with OSS-Fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidKorczynski committed Jan 26, 2021
1 parent 2ce79b9 commit 9c023ef
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/fuzzers/fuzz_read.py
@@ -0,0 +1,26 @@
#!/usr/bin/python3
import os
import sys
import atheris

import imageio

def TestOneInput(data):
with open("/tmp/img1.file", "wb+") as img1_f:
img1_f.write(data)
try:
imageio.imread("/tmp/img1.file")
except ValueError:
None
except RuntimeError:
None
os.remove("/tmp/img1.file")


def main():
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)
atheris.Fuzz()


if __name__ == "__main__":
main()

0 comments on commit 9c023ef

Please sign in to comment.