g_dbus_connection_export_menu_model(): fix a crash
authorRyan Lortie <desrt@desrt.ca>
Mon, 29 Oct 2012 08:09:49 +0000 (09:09 +0100)
committerRyan Lortie <desrt@desrt.ca>
Mon, 29 Oct 2012 15:18:10 +0000 (16:18 +0100)
commitf20ae7fcfdaf9adeac3f73242adb798f1a80ddff
tree8773e3ecfca35d057256c7de34ab260ca4c2795a
parent00f4c12bf97432a50e49749895d2c8174e204907
g_dbus_connection_export_menu_model(): fix a crash

Add some extra protection when 'preparing' a group that doesn't yet
contain any menus.  This can happen if you subscribe to a group that
doesn't yet exist.

It was possible to crash any application using
g_dbus_connection_export_menu_model() by requesting a non-existent
subscription group over the bus.

In practice this only happened in races -- where the proxy sees a group
that exists and queries it, but by the time it does, it's already gone.

https://bugzilla.gnome.org/show_bug.cgi?id=687089
gio/gmenuexporter.c