diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-04-12 13:41:09 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-12 13:41:09 +0000 |
commit | e7d5c7f48ead8f5554105da9637fd9de1c093d67 (patch) | |
tree | d2d680785cd6c64799530b650b61b81253a7a095 /testing | |
parent | 62110c9ce5e0d74319e25f0f41fd241f4aeeac42 (diff) | |
download | pdfium-e7d5c7f48ead8f5554105da9637fd9de1c093d67.tar.xz |
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 <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/libfuzzer/pdf_xml_fuzzer.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>(const_cast<uint8_t*>(data), size); - CFX_XMLDoc doc; - if (!doc.Load(stream)) + + auto root = pdfium::MakeUnique<CFX_XMLNode>(); + 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) |