sw/source/core/doc/DocumentContentOperationsManager.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 3ca44fbba078872e5f91e74d2e92cbef65b0358d
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Oct 10 20:01:57 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Oct 11 21:34:48 2024 +0200

    cid#1607965 Overflowed constant
    
    Change-Id: I743753e75c8c883c9dd88af8e062b73998e82047
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174774
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index bcd58192d800..d8314992364a 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -905,7 +905,8 @@ namespace
         rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( ( eOld & 
~RedlineFlags::Ignore) | RedlineFlags::On );
         SwRedlineTable& rRedlTable = 
rDoc.getIDocumentRedlineAccess().GetRedlineTable();
 
-        do {
+        for (;;)
+        {
             SwRangeRedline* pTmp = rRedlTable[ nRedlPos ];
 
             auto [pRStt, pREnd] = pTmp->StartEnd(); // SwPosition*
@@ -957,7 +958,10 @@ namespace
             else
                 break;
 
-        } while( ++nRedlPos < 
rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() );
+            if (nRedlPos >= 
rDoc.getIDocumentRedlineAccess().GetRedlineTable().size())
+                break;
+            ++nRedlPos;
+        }
         rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
     }
 

Reply via email to