summaryrefslogtreecommitdiff
path: root/vcl/source/window/mouse.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-01-29 21:06:35 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-01-30 09:08:47 +0100
commitf12fc2d07e6f2e9d33ad9350b1f005cbcbe72a18 (patch)
treed1fea82a217600902c24742617aa2f7c4d141c8c /vcl/source/window/mouse.cxx
parent447e4209fa16e765d9cba9f1c80bf10e8901204c (diff)
vcl: fix UB in vcl::Cursor::ImplDoShow()
pWindow->mpWindowImpl can be nullptr here, see online.git's unit-load-torture test: vcl/source/window/cursor.cxx:204:54: runtime error: member access within null pointer of type 'WindowImpl' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior vcl/source/window/cursor.cxx:204:54 in (And one more similar case in Window::ImplGrabFocus().) Change-Id: Idd145082b58c10139be53e9b997efedeb0cec364 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87709 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/source/window/mouse.cxx')
-rw-r--r--vcl/source/window/mouse.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 0aea5205fbb5..16993d199987 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -312,7 +312,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
pSVData->mpWinData->mpFocusWin = this;
- if ( pOldFocusWindow )
+ if ( pOldFocusWindow && pOldFocusWindow->mpWindowImpl )
{
// Cursor hidden
if ( pOldFocusWindow->mpWindowImpl->mpCursor )