From e7d5c7f48ead8f5554105da9637fd9de1c093d67 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 12 Apr 2018 13:41:09 +0000 Subject: Remove CFX_XMLDoc and call the parser directly This CL removes the CFX_XMLDoc and calls the CFX_XMLParser directly from CXFA_DocumentParser. Change-Id: I4d715cca90cd15b5e1d79827e0bb2781e873e371 Reviewed-on: https://pdfium-review.googlesource.com/30251 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- testing/libfuzzer/pdf_xml_fuzzer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'testing/libfuzzer') diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/libfuzzer/pdf_xml_fuzzer.cc index 2ad57cf8bc..a8af779259 100644 --- a/testing/libfuzzer/pdf_xml_fuzzer.cc +++ b/testing/libfuzzer/pdf_xml_fuzzer.cc @@ -9,7 +9,6 @@ #include "core/fxcrt/cfx_seekablestreamproxy.h" #include "core/fxcrt/fx_safe_types.h" #include "core/fxcrt/fx_system.h" -#include "core/fxcrt/xml/cfx_xmldoc.h" #include "core/fxcrt/xml/cfx_xmlnode.h" #include "core/fxcrt/xml/cfx_xmlparser.h" #include "third_party/base/ptr_util.h" @@ -22,11 +21,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { RetainPtr stream = pdfium::MakeRetain(const_cast(data), size); - CFX_XMLDoc doc; - if (!doc.Load(stream)) + + auto root = pdfium::MakeUnique(); + CFX_XMLParser parser(root.get(), stream); + if (!parser.Parse()) return 0; - auto root = doc.GetTree(); for (CFX_XMLNode* pXMLNode = root->GetFirstChild(); pXMLNode; pXMLNode = pXMLNode->GetNextSibling()) { if (pXMLNode->GetType() == FX_XMLNODE_Element) -- cgit v1.2.3