diff --git a/projects/lxml/fuzz_xml_parse.py b/projects/lxml/fuzz_xml_parse.py index ecf90883f..e5e616b02 100644 --- a/projects/lxml/fuzz_xml_parse.py +++ b/projects/lxml/fuzz_xml_parse.py @@ -22,17 +22,25 @@ with atheris.instrument_imports(): def TestOneInput(data): + tree = None + success = False try: root = et.XML(data) if root != None: et.indent(root) tree = et.ElementTree(root) - a = et.Element("a") - tree.getelementpath(a) + success = True except et.XMLSyntaxError: None + if success: + try: + a = et.Element("a") + tree.getelementpath(a) + except ValueError: + None + def main(): atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)