[gnome-control-center/gnome-42] notifications: fix potential null dereference in app_info_get_id()



commit a8c1b82ed8116cd2ab825dc809723c782a8b691e
Author: Andy Holmes <andrew g r holmes gmail com>
Date:   Thu Jun 30 11:11:06 2022 -0700

    notifications: fix potential null dereference in app_info_get_id()
    
    Although apparently unlikely, `strlen()` is called on the return value
    of `desktop_id` instead of `ret`, which may result in a null
    dereference.

 panels/notifications/cc-notifications-panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/panels/notifications/cc-notifications-panel.c b/panels/notifications/cc-notifications-panel.c
index f3408586c..78d189368 100644
--- a/panels/notifications/cc-notifications-panel.c
+++ b/panels/notifications/cc-notifications-panel.c
@@ -344,7 +344,7 @@ app_info_get_id (GAppInfo *app_info)
   if (G_UNLIKELY (g_str_has_suffix (ret, ".desktop") == FALSE))
     return NULL;
 
-  l = strlen (desktop_id);
+  l = strlen (ret);
   *(ret + l - strlen(".desktop")) = '\0';
   return g_steal_pointer (&ret);
 }


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