sc/source/core/data/column3.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit c20db9a219699f689d0096fb11fe72d10034c6f0
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Nov 8 17:49:52 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 25 13:30:09 2024 +0100

    cid#1607047 Overflowed integer argument
    
    Change-Id: I60c991ba32c85ed872c6086104774259d1ac3b24
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177239
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f540f8fe77be..825d0bb58d02 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -580,10 +580,11 @@ void ScColumn::AttachFormulaCells( 
sc::StartListeningContext& rCxt, SCROW nRow1,
         {
             nRow1 = std::min( nRow1, rCell.GetSharedTopRow());
             SCROW nCellLen = rCell.GetSharedLength();
-            assert(nCellLen > 0);
-            if (nRow2 < rCell.GetSharedTopRow() + nCellLen)
+            // coverity[ tainted_data_return : FALSE ] version 2023.12.2
+            const auto nEndRow = rCell.GetSharedTopRow() + nCellLen;
+            if (nRow2 < nEndRow)
             {
-                nRow2 = rCell.GetSharedTopRow() + nCellLen - 1;
+                nRow2 = nEndRow - 1;
                 bEnlargedDown = true;
                 // Same end row is also enlarged, i.e. doesn't need to be
                 // checked for another group.

Reply via email to