sw/source/core/doc/DocumentContentOperationsManager.cxx |    6 ++++--
 xmlhelp/source/cxxhelp/provider/databases.cxx           |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 2596131a1fcb40cd134200035049c23113d3e141
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Sep 28 15:11:10 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Sep 28 20:09:32 2024 +0200

    cid#1607687 Overflowed constant
    
    This code does not appear to be handling the case where there
    is no anchor correctly, all the way back to
    
        commit c5718b941491ffaa937767c579627444c0957b86
        Author: Andreas Bille <a...@openoffice.org>
        Date:   Wed Oct 31 12:08:14 2001 +0000
        #83054#
        Now reading the necessary variables( provider.cxx ),
    
    Change-Id: Ia8f514a95ca2e3ae17129b34f0ed444cd9d0ade8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174122
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx 
b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 86d521f11d89..6119d8373f92 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -592,7 +592,7 @@ void KeywordInfo::KeywordElement::init( Databases const 
*pDatabases,helpdatafile
         if( idx == std::u16string_view::npos )
             break;
         size_t h = ids.find( '#', k );
-        if( h == std::u16string_view::npos || h < idx )
+        if( h != std::u16string_view::npos && h < idx )
         {
             // found an anchor
             id.push_back( OUString(ids.substr( k, h-k )) );
commit 2264538ec245839651de4e34cec45958460c4021
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Sep 28 14:59:14 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Sep 28 20:09:18 2024 +0200

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

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 0f24abd95bc3..79ad75ea2007 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -828,7 +828,7 @@ namespace
         // iterate over relevant redlines and decide for each whether it should
         // be saved, or split + saved
         SwRedlineTable& rRedlineTable = 
rDoc.getIDocumentRedlineAccess().GetRedlineTable();
-        for( ; nCurrentRedline < rRedlineTable.size(); nCurrentRedline++ )
+        for( ; nCurrentRedline < rRedlineTable.size(); )
         {
             SwRangeRedline* pCurrent = rRedlineTable[ nCurrentRedline ];
             SwComparePosition eCompare =
@@ -843,7 +843,7 @@ namespace
                 eCompare == SwComparePosition::Inside ||
                 eCompare == SwComparePosition::Equal )
             {
-                rRedlineTable.Remove( nCurrentRedline-- );
+                rRedlineTable.Remove( nCurrentRedline );
 
                 // split beginning, if necessary
                 if( eCompare == SwComparePosition::OverlapBefore  ||
@@ -868,6 +868,8 @@ namespace
                 // save the current redline
                 rArr.emplace_back( pCurrent, *pStart );
             }
+            else
+                nCurrentRedline++;
         }
 
         // restore old redline mode

Reply via email to