summaryrefslogtreecommitdiffstats
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-11 17:22:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-11 21:38:54 +0100
commit6afb78d3dd130a513c2dd0bee924a3775fcf0b97 (patch)
tree384435c373f2f17c211e02388352d73013d23f1e /starmath
parentlimit WEBSERVICE to http[s] protocols (diff)
downloadcore-6afb78d3dd130a513c2dd0bee924a3775fcf0b97.tar.gz
core-6afb78d3dd130a513c2dd0bee924a3775fcf0b97.zip
ofz#5244 tighten depth check
Change-Id: Ia841f3419ebe14d8f73d09a6fc089973252725ff Reviewed-on: https://gerrit.libreoffice.org/47770 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/parse.hxx2
-rw-r--r--starmath/source/mathtype.cxx2
-rw-r--r--starmath/source/node.cxx2
3 files changed, 3 insertions, 3 deletions
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 5d1eeef553d4..d5e014e6717b 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -53,7 +53,7 @@ class SmParser
{
++m_rParseDepth;
}
- bool TooDeep() const { return m_rParseDepth > 2048; }
+ bool TooDeep() const { return m_rParseDepth > 1024; }
~DepthProtect()
{
--m_rParseDepth;
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index da040887adc2..402a75f0a613 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -647,7 +647,7 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
sal_uInt8 nVariation, int nMatrixRows, int nMatrixCols)
{
//depth-protect
- if (nLevel > 2048)
+ if (nLevel > 1024)
return false;
sal_uInt8 nTag,nRecord;
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index d316e9228023..b7a138e2da9b 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -219,7 +219,7 @@ void SmNode::PrepareAttributes()
void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth)
{
- if (nDepth > 2048)
+ if (nDepth > 1024)
throw std::range_error("parser depth limit");
mbIsPhantom = false;