diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-03-26 09:22:56 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2024-06-27 18:23:10 +0200 |
commit | 9fe2eab098ca40094932da7a69bb6ae4928739f2 (patch) | |
tree | 586f72091a905f352d8a474e3392337906bac623 | |
parent | e6bc1729d93f5e657229eca96e18fc9aa6445fe6 (diff) |
ofz#67635 Integer-overflow
Change-Id: Ia764276d6b35ea84d7415484eaeb9da77e55092a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165307
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 9d1275974d23c520a706129807443ff909719e23)
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 1de06c9694b8..cf8a7769e562 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -606,13 +606,12 @@ void ScHTMLLayoutParser::Adjust() //FIXME: This may not be correct, but works anyway ... pE->nColOverlap = 1; } - xLockedList->Join( ScRange( pE->nCol, pE->nRow, 0, - pE->nCol + pE->nColOverlap - 1, pE->nRow + pE->nRowOverlap - 1, 0 ) ); + SCCOL nColTmp = o3tl::saturating_add(pE->nCol, pE->nColOverlap); + SCROW nRowTmp = o3tl::saturating_add(pE->nRow ,pE->nRowOverlap); + xLockedList->Join( ScRange( pE->nCol, pE->nRow, 0, nColTmp - 1, nRowTmp - 1, 0 ) ); // Take over MaxDimensions - SCCOL nColTmp = pE->nCol + pE->nColOverlap; if ( nColMax < nColTmp ) nColMax = nColTmp; - SCROW nRowTmp = pE->nRow + pE->nRowOverlap; if ( nRowMax < nRowTmp ) nRowMax = nRowTmp; } |