sc/source/filter/html/htmlpars.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 21250dc9c5787d9274837b2bf39c32c2627e44b4
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Jul 27 20:54:18 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Jul 28 16:34:48 2024 +0200

    ofz#68339 Timeout
    
    ofz took the reduction in size limit to 256 bytes as a challenge so
    produced a hang with a 187 byte testcase
    
    Change-Id: Ia9a93e6fd846127be2f842949f4338e819432ebc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171125
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index fdbca6056c92..2ef84c4cdb12 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -559,9 +559,10 @@ void ScHTMLLayoutParser::SkipLocked( ScEEParseEntry* pE, 
bool bJoin )
             ScRange & rR = (*xLockedList)[i];
             if ( rR.Intersects( aRange ) )
             {
-                pE->nCol = rR.aEnd.Col() + 1;
-                SCCOL nTmp = pE->nCol + pE->nColOverlap - 1;
-                if ( pE->nCol > mpDoc->MaxCol() || nTmp > mpDoc->MaxCol() )
+                SCCOL nTmp(0);
+                bFail = o3tl::checked_add<SCCOL>(rR.aEnd.Col(), 1, pE->nCol) ||
+                        o3tl::checked_add<SCCOL>(pE->nCol, pE->nRowOverlap - 
1, nTmp);
+                if ( bFail || pE->nCol > mpDoc->MaxCol() || nTmp > 
mpDoc->MaxCol() )
                     bBadCol = true;
                 else
                 {

Reply via email to