[mutter/benzea/fix-notification-crash: 14/14] startup: Fix possible crash in startup notifications




commit 07aef686709690d95ef0b2a88fc278288e5df81b
Author: Benjamin Berg <bberg redhat com>
Date:   Fri Jul 31 15:21:32 2020 +0200

    startup: Fix possible crash in startup notifications
    
    A GAppInfo is not guaranteed to have a filename or an application (or
    rather a desktop ID). Add a check for application_id to be non-NULL
    before trying to call sn_launcher_set_application_id, which would crash
    otherwise.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1392

 src/x11/meta-startup-notification-x11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/x11/meta-startup-notification-x11.c b/src/x11/meta-startup-notification-x11.c
index 045ee77687..da80f5e149 100644
--- a/src/x11/meta-startup-notification-x11.c
+++ b/src/x11/meta-startup-notification-x11.c
@@ -355,7 +355,7 @@ meta_x11_startup_notification_launch (MetaX11Display *x11_display,
                            (gpointer *) &func);
         }
 
-      if (func)
+      if (func && application_id)
         func (sn_launcher, application_id);
 
       g_module_close (self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]