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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 14 15:00:07 UTC 2020


 vcl/source/window/mouse.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1663c19834fbff0b9bddfaa7f353c9a1e0589739
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Jan 29 21:06:35 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Dec 14 15:59:26 2020 +0100

    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().)
    
    (cherry picked from commit f12fc2d07e6f2e9d33ad9350b1f005cbcbe72a18)
    
    Conflicts:
            vcl/source/window/cursor.cxx
    
    Change-Id: Idd145082b58c10139be53e9b997efedeb0cec364
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107597
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 01adba1a2b80..47116725856f 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -313,7 +313,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
 
     pSVData->mpWinData->mpFocusWin = this;
 
-    if ( pOldFocusWindow )
+    if ( pOldFocusWindow && pOldFocusWindow->mpWindowImpl )
     {
         // Cursor hidden
         if ( pOldFocusWindow->mpWindowImpl->mpCursor )


More information about the Libreoffice-commits mailing list