sc/source/core/tool/chartpos.cxx |    2 +-
 sc/source/core/tool/interpr3.cxx |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 92618090a370c0f57be64d9f19cead2e87cc0d02
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Nov 9 15:45:30 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Nov 11 18:22:40 2024 +0100

    cid#1607751 silence Overflowed constant
    
    Change-Id: I809149469d5393250e86116c37a41f7a52682484
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176384
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index 51736ecd23a3..c3bb069be92c 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -142,8 +142,8 @@ void ScChartPositioner::GlueState()
         if ( i < nRanges )
             pR = &(*aRangeListRef)[i];
     }
-    assert(nEndCol >= nStartCol);
     SCCOL nC = nEndCol - nStartCol + 1;
+    assert(nC > 0 && "coverity 2023.12.2");
     if ( nC == 1 )
     {
         eGlue = ScChartGlue::Rows;
commit 7571696cdb075038e8a0d51d6fc8320a2c0d663f
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Nov 9 19:40:09 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Nov 11 18:22:33 2024 +0100

    cid#1607456 silence Overflowed constant
    
    Change-Id: I6b8391df0d404e1e39d27a979d5e27211661fbac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176383
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 59787aba62f7..8567c0a8fde0 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -5274,7 +5274,10 @@ static void lcl_roundUpNearestPow2(SCSIZE& nNum, SCSIZE& 
nNumBits)
     }
 
     if (nPow2 != nNum)
+    {
+        assert(nPow2 < 1UL << (std::numeric_limits<unsigned long>::digits - 
1));
         nNum = nPow2 ? (nPow2 << 1) : 1;
+    }
     else
         --nNumBits;
 }

Reply via email to