diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-12-05 17:20:03 -0800 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-12-05 17:20:03 -0800 |
commit | 06428d249c139f9082ea8e01e6e91b5990756bd1 (patch) | |
tree | 27b1349a430f53029ed66ac512cb221853b52e18 /xfa/src | |
parent | 5645138a00db8b494e48eb214b95d15e620e1771 (diff) | |
download | pdfium-06428d249c139f9082ea8e01e6e91b5990756bd1.tar.xz |
check NULL of pTemplateRoot in DoDataMerge
BUG= https://code.google.com/p/pdfium/issues/detail?id=89
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/786523004
Diffstat (limited to 'xfa/src')
-rw-r--r-- | xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp index f747cb5719..f496e484ce 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp @@ -1125,7 +1125,6 @@ CXFA_Node * CXFA_Document::GetNotBindNode(CXFA_ObjArray& arrayNodes) }
void CXFA_Document::DoDataMerge()
{
- CXFA_Node* pTemplateRoot = m_pRootNode->GetFirstChildByClass(XFA_ELEMENT_Template);
CXFA_Node* pDatasetsRoot = (CXFA_Node*)GetXFANode(XFA_HASHCODE_Datasets);
if(!pDatasetsRoot) {
IFDE_XMLElement* pDatasetsXMLNode = IFDE_XMLElement::Create(FX_WSTRC(L"xfa:datasets"));
@@ -1174,6 +1173,10 @@ void CXFA_Document::DoDataMerge() }
CXFA_Node* pDataTopLevel = pDataRoot->GetFirstChildByClass(XFA_ELEMENT_DataGroup);
FX_DWORD dwNameHash = pDataTopLevel ? pDataTopLevel->GetNameHash() : 0;
+ CXFA_Node* pTemplateRoot = m_pRootNode->GetFirstChildByClass(XFA_ELEMENT_Template);
+ if (!pTemplateRoot) {
+ return;
+ }
CXFA_Node* pTemplateChosen = dwNameHash != 0 ? pTemplateRoot->GetFirstChildByName(dwNameHash) : NULL;
if(!pTemplateChosen || pTemplateChosen->GetClassID() != XFA_ELEMENT_Subform) {
pTemplateChosen = pTemplateRoot->GetFirstChildByClass(XFA_ELEMENT_Subform);
|