sc/source/ui/view/gridwin4.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit c62e5a0de38dc0ff75ae9da7a91e6c77ee751617 Author: Andras Timar <[email protected]> AuthorDate: Thu Feb 26 16:03:39 2026 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Feb 27 10:00:51 2026 +0100 Fix SIGSEGV in InvalidateByForeignEditView with stale tab data When FetchTableData() returns nullptr during collaborative editing (e.g. concurrent sheet deletion), GetCurXForTab/GetCurYForTab return -1. These invalid coordinates propagate to GetPattern() which returns nullptr, causing a null pointer dereference in SfxItemSet::Get(). Validate the coordinates before passing them to GetEditArea(). Change-Id: I084ab156140d60ee95772ca0c5690028ecdaca44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200448 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index ecd1302b4153..6603d72679bd 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1711,6 +1711,9 @@ bool ScGridWindow::InvalidateByForeignEditView(EditView* pEditView) tools::Long nX = rViewData.GetCurXForTab(nRefTabNo); tools::Long nY = rViewData.GetCurYForTab(nRefTabNo); + if (nX < 0 || nY < 0) + return false; + tools::Rectangle aPixRect = getViewData().GetEditArea(eWhich, nX, nY, this, nullptr, true); tools::Rectangle aLogicRect = PixelToLogic(aPixRect, getViewData().GetLogicMode()); Invalidate(pEditView->IsNegativeX() ? lcl_negateRectX(aLogicRect) : aLogicRect);
