diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-19 09:19:57 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-19 13:33:07 +0000 |
commit | 0d86ecb08e1b2c204333b1f1f6b0b014e5b2971c (patch) | |
tree | f816429f8581c16a60773eb23385dc8e55729bac /testing/libfuzzer | |
parent | 3b71d26f092ebc86ca9177fbbe89d83caa67ae1b (diff) | |
download | pdfium-0d86ecb08e1b2c204333b1f1f6b0b014e5b2971c.tar.xz |
Move fde XML parser to core
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 <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'testing/libfuzzer')
-rw-r--r-- | testing/libfuzzer/pdf_xml_fuzzer.cc | 32 |
1 files changed, 16 insertions, 16 deletions
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<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>(const_cast<uint8_t*>(data), size); - auto doc = pdfium::MakeUnique<CFDE_XMLDoc>(); - if (!doc->LoadXML(pdfium::MakeUnique<CFDE_XMLParser>(doc->GetRoot(), stream))) + auto doc = pdfium::MakeUnique<CFX_XMLDoc>(); + if (!doc->LoadXML(pdfium::MakeUnique<CFX_XMLParser>(doc->GetRoot(), stream))) return 0; if (doc->DoLoad(nullptr) < 100) |