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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 11 08:19:52 UTC 2020


 sfx2/source/control/bindings.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 12ddf044693fbe205844d796c2f31bb706f63584
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Mar 10 21:11:55 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Mar 11 09:19:21 2020 +0100

    sfx2: fix UB in SfxBindings::LeaveRegistrations()
    
    Seen during online.git's unit-wopi-temp test:
    
    sfx2/source/control/bindings.cxx:1374:45: runtime error: member call on null pointer of type 'SfxApplication'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior sfx2/source/control/bindings.cxx:1374:45 in
    
    Assume that no longer having a SfxApplication is the same as IsDowning()
    returning true.
    
    Change-Id: I31149e98d18202e99d95638470428b2bce16dfc5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90304
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index cf5dff142be9..559779e7f127 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1371,7 +1371,7 @@ void SfxBindings::LeaveRegistrations( const char *pFile, int nLine )
     pImpl->nOwnRegLevel--;
 
     // check if this is the outer most level
-    if ( --nRegLevel == 0 && !SfxGetpApp()->IsDowning() )
+    if ( --nRegLevel == 0 && SfxGetpApp() && !SfxGetpApp()->IsDowning() )
     {
         if ( pImpl->bContextChanged )
         {


More information about the Libreoffice-commits mailing list