[gnome-panel] status-notifier: avoid a critical



commit 23c8af111e08b51f2df6d7e3eeea8c3ef82d07aa
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Jan 20 16:18:07 2018 +0200

    status-notifier: avoid a critical
    
    WindowId property should be unsigned int, but there are items
    that has decided to use signed int. Just ignore property if it
    does not have correct type.

 modules/status-notifier/sn-item-v0.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/modules/status-notifier/sn-item-v0.c b/modules/status-notifier/sn-item-v0.c
index 780e44a..0a1fa35 100644
--- a/modules/status-notifier/sn-item-v0.c
+++ b/modules/status-notifier/sn-item-v0.c
@@ -892,7 +892,12 @@ get_all_cb (GObject      *source_object,
       else if (g_strcmp0 (key, "Status") == 0)
         v0->status = g_variant_dup_string (value, NULL);
       else if (g_strcmp0 (key, "WindowId") == 0)
-        v0->window_id = g_variant_get_uint32 (value);
+        {
+          if (g_variant_is_of_type (value, G_VARIANT_TYPE ("u")))
+            v0->window_id = g_variant_get_uint32 (value);
+          else
+            v0->window_id = 0;
+        }
       else if (g_strcmp0 (key, "IconName") == 0)
         v0->icon_name = g_variant_dup_string (value, NULL);
       else if (g_strcmp0 (key, "IconPixmap") == 0)


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