summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-10-27 15:12:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-10-27 17:33:53 +0200
commit7ba33498303b5c9761d14feb03074d8392e15b2e (patch)
treeff3a49a31ecf8c7a0c5f9c39bea5cb940e034ba7 /sc/source
parentfea331bd4ed15288a80c09338a5ca481f9656235 (diff)
ofz: Timeout, clamp hyperlink range when fuzzing
Change-Id: I604a20c8f239bdec00317e3e9e2a7476f5a3ee83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124281 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/filter/excel/xicontent.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 6a6484fde17f..15718a1fb5d3 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -31,6 +31,7 @@
#include <editeng/flditem.hxx>
#include <editeng/editobj.hxx>
#include <unotools/charclass.hxx>
+#include <unotools/configmgr.hxx>
#include <stringutil.hxx>
#include <cellform.hxx>
#include <cellvalue.hxx>
@@ -420,6 +421,17 @@ void XclImpHyperlink::InsertUrl( XclImpRoot& rRoot, const XclRange& rXclRange, c
SCCOL nScCol1, nScCol2;
SCROW nScRow1, nScRow2;
aScRange.GetVars( nScCol1, nScRow1, nScTab, nScCol2, nScRow2, nScTab );
+
+ if (utl::ConfigManager::IsFuzzing())
+ {
+ SCROW nRows = nScRow2 - nScRow1;
+ if (nRows > 1024)
+ {
+ SAL_WARN("sc.filter", "for fuzzing performance, clamped hyperlink apply range end row from " << nScRow2 << " to " << nScRow1 + 1024);
+ nScRow2 = nScRow1 + 1024;
+ }
+ }
+
for( SCCOL nScCol = nScCol1; nScCol <= nScCol2; ++nScCol )
for( SCROW nScRow = nScRow1; nScRow <= nScRow2; ++nScRow )
lclInsertUrl( rRoot, aUrl, nScCol, nScRow, nScTab );