summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/libfuzzer/pdf_xml_fuzzer.cc27
1 files changed, 11 insertions, 16 deletions
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<IFDE_XMLDoc> doc(IFDE_XMLDoc::Create());
- if (!doc)
- return 0;
-
- std::unique_ptr<IFDE_XMLParser, ReleaseDeleter<IFDE_XMLParser>> parser(
+ std::unique_ptr<CFDE_XMLDoc> doc(new CFDE_XMLDoc);
+ std::unique_ptr<CFDE_XMLParser, ReleaseDeleter<CFDE_XMLParser>> parser(
new CXFA_XMLParser(doc->GetRoot(), stream.get()));
- if (!parser)
- return 0;
if (!doc->LoadXML(parser.release()))
return 0;