From 0d86ecb08e1b2c204333b1f1f6b0b014e5b2971c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 19 Apr 2017 09:19:57 -0400 Subject: Move fde XML parser to core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL moves the XML parser from FDE into FXCRT and renames to CFX_ from CFDE_. Change-Id: I21a9590bf74daf5517df630d7e7a5de89da99ea4 Reviewed-on: https://pdfium-review.googlesource.com/4312 Commit-Queue: dsinclair Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña --- testing/libfuzzer/pdf_xml_fuzzer.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'testing/libfuzzer') diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/libfuzzer/pdf_xml_fuzzer.cc index 92b61bcd65..be77016b60 100644 --- a/testing/libfuzzer/pdf_xml_fuzzer.cc +++ b/testing/libfuzzer/pdf_xml_fuzzer.cc @@ -10,30 +10,30 @@ #include "core/fxcrt/fx_basic.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" -#include "xfa/fde/xml/cfde_xmldoc.h" -#include "xfa/fde/xml/cfde_xmlnode.h" -#include "xfa/fde/xml/cfde_xmlparser.h" namespace { -CFDE_XMLNode* XFA_FDEExtension_GetDocumentNode( - CFDE_XMLDoc* pXMLDoc, +CFX_XMLNode* XFA_FDEExtension_GetDocumentNode( + CFX_XMLDoc* pXMLDoc, bool bVerifyWellFormness = false) { if (!pXMLDoc) { return nullptr; } - CFDE_XMLNode* pXMLFakeRoot = pXMLDoc->GetRoot(); - for (CFDE_XMLNode* pXMLNode = - pXMLFakeRoot->GetNodeItem(CFDE_XMLNode::FirstChild); - pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling)) { - if (pXMLNode->GetType() == FDE_XMLNODE_Element) { + CFX_XMLNode* pXMLFakeRoot = pXMLDoc->GetRoot(); + for (CFX_XMLNode* pXMLNode = + pXMLFakeRoot->GetNodeItem(CFX_XMLNode::FirstChild); + pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFX_XMLNode::NextSibling)) { + if (pXMLNode->GetType() == FX_XMLNODE_Element) { if (bVerifyWellFormness) { - for (CFDE_XMLNode* pNextNode = - pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling); + for (CFX_XMLNode* pNextNode = + pXMLNode->GetNodeItem(CFX_XMLNode::NextSibling); pNextNode; - pNextNode = pNextNode->GetNodeItem(CFDE_XMLNode::NextSibling)) { - if (pNextNode->GetType() == FDE_XMLNODE_Element) { + pNextNode = pNextNode->GetNodeItem(CFX_XMLNode::NextSibling)) { + if (pNextNode->GetType() == FX_XMLNODE_Element) { return nullptr; } } @@ -54,8 +54,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { CFX_RetainPtr stream = pdfium::MakeRetain(const_cast(data), size); - auto doc = pdfium::MakeUnique(); - if (!doc->LoadXML(pdfium::MakeUnique(doc->GetRoot(), stream))) + auto doc = pdfium::MakeUnique(); + if (!doc->LoadXML(pdfium::MakeUnique(doc->GetRoot(), stream))) return 0; if (doc->DoLoad(nullptr) < 100) -- cgit v1.2.3