sc/source/core/tool/interpr3.cxx |    1 +
 sc/source/filter/excel/impop.cxx |    7 +++----
 tools/source/generic/config.cxx  |   16 +++++-----------
 3 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 051365a71fa51f8ef01a4c91a83f3e38472be58f
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Nov 1 09:46:58 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 4 09:38:46 2024 +0100

    cid#1606943 Overflowed constant
    
    Change-Id: I056e45e19bb3794acbdf7b5c2b4ecb787e52de0c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175975
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 00b3aef2c2c7..9fa470b854ba 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -255,7 +255,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
             assert(nLineLen > 0);
             nLineLen--;
             // remove spaces and tabs
-            while ( (*pLine == ' ') || (*pLine == '    ') )
+            while ( nLineLen > 0 && (*pLine == ' ' || *pLine == '      ') )
             {
                 nLineLen--;
                 pLine++;
@@ -263,11 +263,8 @@ static void ImplMakeConfigList( ImplConfigData* pData,
             nNameLen = 0;
             while ( (nNameLen < nLineLen) && (pLine[nNameLen] != ']') )
                 nNameLen++;
-            if ( nNameLen )
-            {
-                while ( (pLine[nNameLen-1] == ' ') || (pLine[nNameLen-1] == '  
') )
-                    nNameLen--;
-            }
+            while ( nNameLen > 0 && (pLine[nNameLen-1] == ' ' || 
pLine[nNameLen-1] == '        ') )
+                nNameLen--;
             pGroup->maGroupName = makeOString(pLine, nNameLen);
         }
         else
@@ -320,11 +317,8 @@ static void ImplMakeConfigList( ImplConfigData* pData,
                         nNameLen++;
                     nKeyLen = nNameLen;
                     // Remove spaces and tabs
-                    if ( nNameLen )
-                    {
-                        while ( (pLine[nNameLen-1] == ' ') || 
(pLine[nNameLen-1] == '  ') )
-                            nNameLen--;
-                    }
+                    while ( nNameLen > 0 && (pLine[nNameLen-1] == ' ' || 
pLine[nNameLen-1] == '        ') )
+                        nNameLen--;
                     pKey->maKey = makeOString(pLine, nNameLen);
                     nKeyLen++;
                     if ( nKeyLen < nLineLen )
commit 5bca5b23b783bf20b0a030bab0e5b678e811a4a3
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Oct 18 21:20:52 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 4 09:38:38 2024 +0100

    cid#1606699 silence Overflowed constant
    
    Change-Id: Ib3cac90e56bd00a777871f1b07849fabd7e307a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175974
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index bc6a904c589c..4263f5deb9c7 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -241,9 +241,8 @@ void ImportExcel::ReadDimensions()
     }
     else
     {
-        sal_uInt32 nXclRow1 = 0, nXclRow2 = 0;
-        nXclRow1 = maStrm.ReaduInt32();
-        nXclRow2 = maStrm.ReaduInt32();
+        sal_uInt32 nXclRow1 = maStrm.ReaduInt32();
+        sal_uInt32 nXclRow2 = maStrm.ReaduInt32();
         aXclUsedArea.maFirst.mnCol = maStrm.ReaduInt16();
         aXclUsedArea.maLast.mnCol = maStrm.ReaduInt16();
         if( nXclRow2 != 0 && (nXclRow1 < nXclRow2) && 
(aXclUsedArea.GetColCount() > 1) &&
@@ -251,7 +250,7 @@ void ImportExcel::ReadDimensions()
         {
             // Excel stores first unused row/column index
             --nXclRow2;
-            --aXclUsedArea.maLast.mnCol;
+            aXclUsedArea.maLast.mnCol = 
o3tl::sanitizing_dec(aXclUsedArea.maLast.mnCol);
             // convert row indexes to 16-bit values
             aXclUsedArea.maFirst.mnRow = static_cast< sal_uInt16 >( nXclRow1 );
             aXclUsedArea.maLast.mnRow = limit_cast< sal_uInt16 >( nXclRow2, 
aXclUsedArea.maFirst.mnRow, SAL_MAX_UINT16 );
commit 3c1b7e4fe7146f51afe1205b16a4063d73f93055
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Nov 1 20:30:47 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 4 09:38:32 2024 +0100

    cid#1607290 silence Overflowed constant
    
    Change-Id: Ic05b5a64a3be44d8aba4c9ffaf8867a45f2422db
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175973
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 6f66cd431db1..59787aba62f7 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -1458,6 +1458,7 @@ void ScInterpreter::ScCritBinom()
                         return;
                     }
                 }
+                assert(i > 0 && "coverity 2023.12.2");
                 PushDouble( i - 1 );
             }
         }

Reply via email to