[gnome-panel] status-notifier: don't crash if layout has incorrect type
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] status-notifier: don't crash if layout has incorrect type
- Date: Thu, 28 Dec 2017 23:54:05 +0000 (UTC)
commit a08f238147660b3d70e5eebd8d24707711424719
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Dec 29 00:42:05 2017 +0200
status-notifier: don't crash if layout has incorrect type
It should be '(ia{sv}av)'...
modules/status-notifier/sn-dbus-menu.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/modules/status-notifier/sn-dbus-menu.c b/modules/status-notifier/sn-dbus-menu.c
index 9cbab34..4f28f49 100644
--- a/modules/status-notifier/sn-dbus-menu.c
+++ b/modules/status-notifier/sn-dbus-menu.c
@@ -127,6 +127,15 @@ layout_parse (SnDBusMenu *menu,
GVariantIter iter;
GVariant *child;
+ if (!g_variant_is_of_type (layout, G_VARIANT_TYPE ("(ia{sv}av)")))
+ {
+ g_warning ("Type of return value for 'layout' property in "
+ "'GetLayout' call should be '(ia{sv}av)' but got '%s'",
+ g_variant_get_type_string (layout));
+
+ return;
+ }
+
g_variant_get (layout, "(i@a{sv}@av)", &id, &props, &items);
submenu = layout_update_item (menu, gtk_menu, id, props);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]