diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-03-26 09:22:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-03-26 15:38:45 +0100 |
commit | 9d1275974d23c520a706129807443ff909719e23 (patch) | |
tree | 8c6b979e734a3a9116740ec16ecf3cd1291d603d | |
parent | dd873175affb7926befb1b8a0a881540d00160df (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>
-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 db8256d9e851..5bf4c4c07a83 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -705,13 +705,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; } |