[gnome-panel] status-notifier: don't crash if tooltip has incorrect type



commit 585c6727a807f0160e79f42a1f17350cc6df0d78
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Dec 29 01:52:56 2017 +0200

    status-notifier: don't crash if tooltip has incorrect type
    
    It should be '(sa(iiay)ss)'...

 modules/status-notifier/sn-item-v0.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/modules/status-notifier/sn-item-v0.c b/modules/status-notifier/sn-item-v0.c
index 12b7988..fb1e06d 100644
--- a/modules/status-notifier/sn-item-v0.c
+++ b/modules/status-notifier/sn-item-v0.c
@@ -464,6 +464,14 @@ sn_tooltip_new (GVariant *variant)
   if (variant == NULL)
     return NULL;
 
+  if (!g_variant_is_of_type (variant, G_VARIANT_TYPE ("(sa(iiay)ss)")))
+    {
+      g_warning ("Type for 'ToolTip' property should be '(sa(iiay)ss)' "
+                 "but got '%s'", g_variant_get_type_string (variant));
+
+      return NULL;
+    }
+
   g_variant_get (variant, "(&s@a(iiay)&s&s)",
                  &icon_name, &icon_pixmap,
                  &title, &text);


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