summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-11 14:42:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-11 17:03:45 +0200
commit87586cd0e41b1dbcbf49df993d69ef7aa426f7e0 (patch)
tree3d222cf8b129fefc5cd0fba1f8f1c93e7bb66c78 /xmloff
parent47b1d193b6e1537103c1774f4f045d9fa4210220 (diff)
ofz#32467 Timeout: add arbitrary master page limit when fuzzing
Change-Id: Ic95b84ceb91ccadf9d4f2dd763a4f4ec7b379381 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113950 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/ximpstyl.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index e606c223b39d..a702872a736b 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -48,6 +48,7 @@
#include "layerimp.hxx"
#include <xmloff/XMLGraphicsDefaultStyle.hxx>
#include <XMLNumberStylesImport.hxx>
+#include <unotools/configmgr.hxx>
#include <xmloff/xmlerror.hxx>
#include <xmloff/table/XMLTableImport.hxx>
@@ -1318,6 +1319,10 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLMasterStylesConte
sal_Int32 nMasterPageCount = xMasterPages->getCount();
if (nNewMasterPageCount + 1 > nMasterPageCount)
{
+ // arbitrary limit to master pages when fuzzing to avoid deadend timeouts
+ if (nMasterPageCount >= 64 && utl::ConfigManager::IsFuzzing())
+ return nullptr;
+
// new page, create and insert
xNewMasterPage = xMasterPages->insertNewByIndex(nMasterPageCount);
}