sw/source/core/doc/docredln.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fc37066963a866eeb342b3a41b916f2574f5de28
Author:     Julien Nabet <[email protected]>
AuthorDate: Sun Jun 2 09:20:32 2024 +0200
Commit:     Julien Nabet <[email protected]>
CommitDate: Sun Jun 2 12:27:48 2024 +0200

    cid#1602443: use_after_free
    
    Change-Id: Ic7525bbd2d4d26f6bf07ecfb6ba6cf056a98580a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168339
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    Reviewed-by: Julien Nabet <[email protected]>

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index fe1c917ba9c3..91c4c5a29bff 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -719,11 +719,11 @@ void SwRedlineTable::DeleteAndDestroyAll()
 void SwRedlineTable::DeleteAndDestroy(size_type const nP)
 {
     auto const pRedline = maVector[nP];
+    if (pRedline == mpMaxEndPos)
+        mpMaxEndPos = nullptr;
     maVector.erase(maVector.begin() + nP);
     LOKRedlineNotification(RedlineNotification::Remove, pRedline);
     delete pRedline;
-    if (pRedline == mpMaxEndPos)
-        mpMaxEndPos = nullptr;
 }
 
 SwRedlineTable::size_type SwRedlineTable::FindNextOfSeqNo( size_type nSttPos ) 
const

Reply via email to