summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-02 11:19:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-02 14:38:25 +0200
commite256b08d17c5325500828fac49f946869c9c4752 (patch)
treedc57ecddaa74a3344d3b850f87915be650cd013c
parentBump version to 6.2-31 (diff)
downloadcore-e256b08d17c5325500828fac49f946869c9c4752.tar.gz
core-e256b08d17c5325500828fac49f946869c9c4752.zip
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@collabora.co.uk> (cherry picked from commit 558dface96fbc5f487b16cfa1bf3c3ea20776331) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118263 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r--sw/source/uibase/uiview/uivwimp.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx
index e7ce5be812ab..2f8b55b00043 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -289,6 +289,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 )