[Libreoffice-commits] core.git: vcl/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 5 08:05:32 UTC 2020


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

New commits:
commit cee1568e8915e479732687a7aa3faa639955596d
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Feb 4 21:09:50 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Feb 5 09:04:57 2020 +0100

    vcl: fix UB in Window::ImplNewInputContext()
    
    pFocusWin->mpWindowImpl can be nullptr here, see online.git's
    unit-load-torture test:
    
    vcl/source/window/window2.cxx:1059:26: runtime error: member access within null pointer of type 'WindowImpl'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior vcl/source/window/window2.cxx:1059:26 in
    
    Change-Id: Iebeff5a50d426ffb02c6b15e86631ea110ce81bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87990
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ac4f90123da4..1b888b559a10 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1750,7 +1750,7 @@ void Window::ImplNewInputContext()
 {
     ImplSVData* pSVData = ImplGetSVData();
     vcl::Window* pFocusWin = pSVData->mpWinData->mpFocusWin;
-    if ( !pFocusWin )
+    if ( !pFocusWin || pFocusWin->IsDisposed() )
         return;
 
     // Is InputContext changed?


More information about the Libreoffice-commits mailing list