summaryrefslogtreecommitdiff
path: root/testing/libfuzzer
diff options
context:
space:
mode:
Diffstat (limited to 'testing/libfuzzer')
-rw-r--r--testing/libfuzzer/pdf_xml_fuzzer.cc8
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)