sal/osl/unx/pipe.cxx                                    |    2 ++
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   12 ++++--------
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 15d66da417068051229e8888e9d776a7514b2a46
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Sep 11 08:50:51 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Nov 12 12:53:27 2024 +0100

    cid#1607638 silence Overflowed return value
    
    Change-Id: Ie6f9db4949924a53edd3b0738bee5c21ca6051a8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176463
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index b683e17b2623..436f3086ded5 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -478,6 +478,7 @@ sal_Int32 SAL_CALL osl_writePipe(oslPipe pPipe, const void 
*pBuffer, sal_Int32 n
     SAL_WARN_IF(!pPipe, "sal.osl.pipe", "osl_writePipe: invalid pipe"); // 
osl_sendPipe detects invalid pipe
     while (BytesToSend > 0)
     {
+        // coverity[ tainted_data_return : FALSE ] version 2023.12.2
         sal_Int32 RetVal = osl_sendPipe(pPipe, pBuffer, BytesToSend);
         /* error occurred? */
         if (RetVal <= 0)
@@ -500,6 +501,7 @@ sal_Int32 SAL_CALL osl_readPipe( oslPipe pPipe, void 
*pBuffer , sal_Int32 n )
     SAL_WARN_IF(!pPipe, "sal.osl.pipe", "osl_readPipe: invalid pipe"); // 
osl_receivePipe detects invalid pipe
     while (BytesToRead > 0)
     {
+        // coverity[ tainted_data_return : FALSE ] version 2023.12.2
         sal_Int32 RetVal = osl_receivePipe(pPipe, pBuffer, BytesToRead);
         /* error occurred? */
         if (RetVal <= 0)
commit 007987ffb7d4de050c3b4fa84b5fae33658a8699
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Nov 11 11:34:59 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Nov 12 12:53:14 2024 +0100

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

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 269a3d67e871..c469f12931de 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -905,8 +905,7 @@ namespace
         RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
         rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( ( eOld & 
~RedlineFlags::Ignore) | RedlineFlags::On );
 
-        for (;;)
-        {
+        do {
             SwRangeRedline* pTmp = rRedlTable[ nRedlPos ];
 
             auto [pRStt, pREnd] = pTmp->StartEnd(); // SwPosition*
@@ -931,10 +930,11 @@ namespace
                     SwPosition* pTmpPos = pTmp->End();
                     pTmpPos->Assign(rRg.aEnd);
                 }
+                ++nRedlPos;
             }
             else if( pRStt->GetNode() < rRg.aEnd.GetNode() )
             {
-                rRedlTable.Remove( nRedlPos-- );
+                rRedlTable.Remove( nRedlPos );
                 if( pREnd->GetNode() < rRg.aEnd.GetNode() ||
                     ( pREnd->GetNode() == rRg.aEnd.GetNode() && 
!pREnd->GetContentIndex()) )
                 {
@@ -957,11 +957,7 @@ namespace
             }
             else
                 break;
-
-            if (nRedlPos >= rRedlTable.size())
-                break;
-            ++nRedlPos;
-        }
+        } while( nRedlPos < rRedlTable.size() );
         rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
     }
 

Reply via email to