diff --git a/projects/lxml/fuzz_schematron.py b/projects/lxml/fuzz_schematron.py index e9d7a540c..146ff1871 100644 --- a/projects/lxml/fuzz_schematron.py +++ b/projects/lxml/fuzz_schematron.py @@ -16,24 +16,24 @@ import atheris import sys -import io -with atheris.instrument_imports(): - from lxml import etree as et +import io +from lxml import etree as et def TestOneInput(data): """Targets Schematron. Currently validates, but we should add more APIs""" try: schema_raw = et.parse(io.BytesIO(data)) - valid_tree = et.parse(io.BytesIO('')) + valid_tree = et.parse(io.BytesIO(b'')) - schema = etree.Schematron(schema_raw) + schema = et.Schematron(schema_raw) schame.validate(valid_tree) except et.LxmlError: None def main(): + atheris.instrument_all() atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True) atheris.Fuzz() diff --git a/projects/lxml/fuzz_xmlschema.py b/projects/lxml/fuzz_xmlschema.py index ddf6c28fc..3947e5e9b 100644 --- a/projects/lxml/fuzz_xmlschema.py +++ b/projects/lxml/fuzz_xmlschema.py @@ -26,9 +26,9 @@ def TestOneInput(data): """Targets XML schema validation. More APIs should be added""" try: schema_raw = et.parse(io.BytesIO(data)) - valid_tree = et.parse(io.BytesIO('')) + valid_tree = et.parse(io.BytesIO(b'')) - schema = etree.XMLSchema(schema_raw) + schema = et.XMLSchema(schema_raw) schame.validate(valid_tree) except et.LxmlError: None diff --git a/projects/lxml/fuzz_xslt.py b/projects/lxml/fuzz_xslt.py index 1b3f3ca81..894cfa10f 100644 --- a/projects/lxml/fuzz_xslt.py +++ b/projects/lxml/fuzz_xslt.py @@ -25,9 +25,9 @@ def TestOneInput(data): """Targets XSLT. More APIs on the st object should be added""" try: style = et.parse(io.BytesIO(data)) - valid_tree = et.parse(io.BytesIO('BC')) + valid_tree = et.parse(io.BytesIO(b'BC')) - st = etree.XSLT(style) + st = et.XSLT(style) res = st(valid_tree) except et.LxmlError: None