From f2d9039672f40065a1c288575c34340b1326f569 Mon Sep 17 00:00:00 2001 From: monsta Date: Mon, 22 Jan 2018 16:13:16 +0300 Subject: status-notifier: don't crash if menu layout has wrong type fixes https://github.com/mate-desktop/mate-panel/issues/686 ported from: https://git.gnome.org/browse/gnome-panel/commit/?id=a08f238147660b3d70e5eebd8d24707711424719 --- applets/notification_area/status-notifier/sn-dbus-menu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/applets/notification_area/status-notifier/sn-dbus-menu.c b/applets/notification_area/status-notifier/sn-dbus-menu.c index 855c2569..28633990 100644 --- a/applets/notification_area/status-notifier/sn-dbus-menu.c +++ b/applets/notification_area/status-notifier/sn-dbus-menu.c @@ -126,6 +126,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); -- cgit v1.2.1