sc/source/filter/excel/xicontent.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 7ba33498303b5c9761d14feb03074d8392e15b2e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Oct 27 15:12:52 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Oct 27 17:33:53 2021 +0200

    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 <caol...@redhat.com>

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 );

Reply via email to