summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmparser.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmparser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index be0a31b519..0857573cdf 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -17,6 +17,7 @@ namespace {
constexpr unsigned int kMaxParseDepth = 1250;
constexpr unsigned int kMaxPostExpressions = 256;
+constexpr unsigned int kMaxExpressionListSize = 10000;
} // namespace
@@ -91,6 +92,12 @@ CXFA_FMParser::ParseExpressionList() {
m_error = true;
return std::vector<std::unique_ptr<CXFA_FMExpression>>();
}
+
+ if (expressions.size() >= kMaxExpressionListSize) {
+ m_error = true;
+ return std::vector<std::unique_ptr<CXFA_FMExpression>>();
+ }
+
expressions.push_back(std::move(expr));
}
return expressions;