From ae95f763dfb5e4fab3a9ff026b2f844c202625d7 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 29 Mar 2016 16:58:29 -0700 Subject: Remove IFDE_XML* classes. The CFDE_XML* classes did not inhert from the IFDE_XML variants but we casted to them anyway. This CL removes the IFDE_XML* variants and we just use the CPDF_XML* classes directly. BUG=pdfium:357 Review URL: https://codereview.chromium.org/1836353002 --- testing/libfuzzer/pdf_xml_fuzzer.cc | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'testing/libfuzzer') diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/libfuzzer/pdf_xml_fuzzer.cc index 592bf0f066..998e2ec650 100644 --- a/testing/libfuzzer/pdf_xml_fuzzer.cc +++ b/testing/libfuzzer/pdf_xml_fuzzer.cc @@ -14,22 +14,22 @@ namespace { -IFDE_XMLNode* XFA_FDEExtension_GetDocumentNode( - IFDE_XMLDoc* pXMLDoc, +CFDE_XMLNode* XFA_FDEExtension_GetDocumentNode( + CFDE_XMLDoc* pXMLDoc, FX_BOOL bVerifyWellFormness = FALSE) { if (!pXMLDoc) { return nullptr; } - IFDE_XMLNode* pXMLFakeRoot = pXMLDoc->GetRoot(); - for (IFDE_XMLNode* pXMLNode = - pXMLFakeRoot->GetNodeItem(IFDE_XMLNode::FirstChild); - pXMLNode; pXMLNode = pXMLNode->GetNodeItem(IFDE_XMLNode::NextSibling)) { + 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) { if (bVerifyWellFormness) { - for (IFDE_XMLNode* pNextNode = - pXMLNode->GetNodeItem(IFDE_XMLNode::NextSibling); + for (CFDE_XMLNode* pNextNode = + pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling); pNextNode; - pNextNode = pNextNode->GetNodeItem(IFDE_XMLNode::NextSibling)) { + pNextNode = pNextNode->GetNodeItem(CFDE_XMLNode::NextSibling)) { if (pNextNode->GetType() == FDE_XMLNODE_Element) { return FALSE; } @@ -54,14 +54,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (!stream) return 0; - std::unique_ptr doc(IFDE_XMLDoc::Create()); - if (!doc) - return 0; - - std::unique_ptr> parser( + std::unique_ptr doc(new CFDE_XMLDoc); + std::unique_ptr> parser( new CXFA_XMLParser(doc->GetRoot(), stream.get())); - if (!parser) - return 0; if (!doc->LoadXML(parser.release())) return 0; -- cgit v1.2.3