sc/source/filter/excel/xicontent.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 59d144bb57efa62540b7627e9eead050b7c004f0
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Mar 1 16:21:41 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Mar 2 00:00:23 2026 +0100

    ofz#421950541 bodge-around for timeout
    
    ==252== ERROR: libFuzzer: timeout after 61 seconds
        #0 0x5c6ac292b051 in __sanitizer_print_stack_trace 
/src/llvm-project/compiler-rt/lib/asan/asan_stack.cpp:87:3
        #1 0x5c6ac2854568 in fuzzer::PrintStackTrace() 
/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerUtil.cpp:210:5
        #2 0x5c6ac2837e2b in fuzzer::Fuzzer::AlarmCallback() 
/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:304:5
        #3 0x7edb567ec41f in libpthread.so.0
        #4 0x5c6ac285238f in xlsfuzzer
        #5 0x5c6ac39d4f53 in ScCompiler::ParseColRowName(rtl::OUString const&) 
/src/libreoffice/sc/source/core/tool/compiler.cxx:3858:31
        #6 0x5c6ac39dcbcb in ScCompiler::NextNewToken(bool) 
/src/libreoffice/sc/source/core/tool/compiler.cxx:4761:32
        #7 0x5c6ac39de30b in ScCompiler::CompileString(rtl::OUString const&) 
/src/libreoffice/sc/source/core/tool/compiler.cxx:4891:12
        #8 0x5c6ac36e1ea2 in ScFormulaCell::Compile(rtl::OUString const&, bool, 
formula::FormulaGrammar::Grammar) 
/src/libreoffice/sc/source/core/data/formulacell.cxx:1113:19
        #9 0x5c6ac36e1a33 in ScFormulaCell::ScFormulaCell(ScDocument&, 
ScAddress const&, rtl::OUString const&, formula::FormulaGrammar::Grammar, 
ScMatrixMode) /src/libreoffice/sc/source/core/data/formulacell.cxx:641:5
        #10 0x5c6ac3265802 in ScColumn::ParseString(ScCellValue&, int, short, 
rtl::OUString const&, formula::FormulaGrammar::AddressConvention, 
ScSetStringParam const*) 
/src/libreoffice/sc/source/core/data/column3.cxx:2153:47
        #11 0x5c6ac3266abc in ScColumn::SetString(int, short, rtl::OUString 
const&, formula::FormulaGrammar::AddressConvention, ScSetStringParam const*) 
/src/libreoffice/sc/source/core/data/column3.cxx:2346:23
        #12 0x5c6ac34eea5c in ScDocument::SetString(short, int, short, 
rtl::OUString const&, ScSetStringParam const*) 
/src/libreoffice/sc/source/core/data/document.cxx:3491:18
    
    Change-Id: I68e871b1545d49e67550e6da254f22ac9c0125cc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200718
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/filter/excel/xicontent.cxx 
b/sc/source/filter/excel/xicontent.cxx
index 23abae2e3516..b7769c941108 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -452,11 +452,14 @@ void XclImpLabelranges::ReadLabelranges( XclImpStream& 
rStrm )
     XclRangeList aRowXclRanges, aColXclRanges;
     rStrm >> aRowXclRanges >> aColXclRanges;
 
+    // ofz#421950541 bodge-around for timeout
+    const size_t nMaxRanges = comphelper::IsFuzzing() ? 4 : SAL_MAX_SIZE;
+
     // row label ranges
     ScRangeList aRowScRanges;
     rAddrConv.ConvertRangeList( aRowScRanges, aRowXclRanges, nScTab, false );
     xLabelRangesRef = rDoc.GetRowNameRangesRef();
-    for ( size_t i = 0, nRanges = aRowScRanges.size(); i < nRanges; ++i )
+    for ( size_t i = 0, nRanges = std::min(aRowScRanges.size(), nMaxRanges); i 
< nRanges; ++i )
     {
         const ScRange & rScRange = aRowScRanges[ i ];
         ScRange aDataRange( rScRange );
@@ -478,7 +481,7 @@ void XclImpLabelranges::ReadLabelranges( XclImpStream& 
rStrm )
     rAddrConv.ConvertRangeList( aColScRanges, aColXclRanges, nScTab, false );
     xLabelRangesRef = rDoc.GetColNameRangesRef();
 
-    for ( size_t i = 0, nRanges = aColScRanges.size(); i < nRanges; ++i )
+    for ( size_t i = 0, nRanges = std::min(aColScRanges.size(), nMaxRanges); i 
< nRanges; ++i )
     {
         const ScRange & rScRange = aColScRanges[ i ];
         ScRange aDataRange( rScRange );

Reply via email to