From 01a1d2a84992973b8a0e5f1ae99fd32f5913b58f Mon Sep 17 00:00:00 2001 From: Patrick Luby Date: Mon, 31 Jul 2023 20:03:13 -0400 Subject: tdf#144072 prevent use of a deleted pointer BegDragObj_createInvisibleObjectAtPosition() may clear the handle list and that will delete the SdrHdl instances owned by this section view so set _pHdl to null if it has been deleted during the call. Change-Id: I89606958f8a76a2c35685d1aff6b0159739a464a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155119 Tested-by: Jenkins Reviewed-by: Patrick Luby --- svx/source/svdraw/svdhdl.cxx | 1 - 1 file changed, 1 deletion(-) (limited to 'svx/source/svdraw') diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index de6ffcd8175f..3bcebf59ea26 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2282,7 +2282,6 @@ size_t SdrHdlList::GetHdlNum(const SdrHdl* pHdl) const return SAL_MAX_SIZE; auto it = std::find_if( maList.begin(), maList.end(), [&](const std::unique_ptr & p) { return p.get() == pHdl; }); - assert(it != maList.end()); if( it == maList.end() ) return SAL_MAX_SIZE; return it - maList.begin(); -- cgit