summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document_parser.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_document_parser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp
index 599662a160..8e5ff9fbde 100644
--- a/xfa/fxfa/parser/cxfa_document_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_document_parser.cpp
@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
+#include "core/fxcrt/autorestorer.h"
#include "core/fxcrt/cfx_memorystream.h"
#include "core/fxcrt/cfx_widetextbuf.h"
#include "core/fxcrt/fx_codepage.h"
@@ -768,6 +769,12 @@ CXFA_Node* CXFA_DocumentParser::NormalLoader(CXFA_Node* pXFANode,
CFX_XMLNode* pXMLDoc,
XFA_PacketType ePacketID,
bool bUseAttribute) {
+ constexpr const unsigned long kMaxExecuteRecursion = 1000;
+ if (m_ExecuteRecursionDepth > kMaxExecuteRecursion)
+ return nullptr;
+ AutoRestorer<unsigned long> restorer(&m_ExecuteRecursionDepth);
+ ++m_ExecuteRecursionDepth;
+
bool bOneOfPropertyFound = false;
for (CFX_XMLNode* pXMLChild = pXMLDoc->GetFirstChild(); pXMLChild;
pXMLChild = pXMLChild->GetNextSibling()) {