[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 4 07:10:20 UTC 2021


 sw/source/uibase/uiview/uivwimp.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 0c89088b3974ae5c2e0853a2d9971f2fc00d1d5c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 2 11:19:39 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 4 09:09:43 2021 +0200

    fix potential use-after-free in SwClipboardChangeListener
    
    we think we're seeing this in COOL
    
    Change-Id: I29a287b032158076a99a836d98113d1623ebef99
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118277
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 558dface96fbc5f487b16cfa1bf3c3ea20776331)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118264
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx
index 9dc6d467f941..ee6b5d66de1c 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -292,6 +292,8 @@ SwClipboardChangeListener::~SwClipboardChangeListener()
 
 void SAL_CALL SwClipboardChangeListener::disposing( const EventObject& /*rEventObject*/ )
 {
+    SolarMutexGuard aGuard;
+    pView = nullptr; // so we don't touch the view if changedContents somehow fires afterwards
 }
 
 void SAL_CALL SwClipboardChangeListener::changedContents( const css::datatransfer::clipboard::ClipboardEvent& rEventObject )


More information about the Libreoffice-commits mailing list