ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #01882
[Merge] lp:~ted/dbusmenu/null-values-make-vala-smile into lp:dbusmenu
Ted Gould has proposed merging lp:~ted/dbusmenu/null-values-make-vala-smile into lp:dbusmenu.
Requested reviews:
DBus Menu Team (dbusmenu-team)
NULL protection on the client side of events.
--
https://code.launchpad.net/~ted/dbusmenu/null-values-make-vala-smile/+merge/29875
Your team ayatana-commits is subscribed to branch lp:dbusmenu.
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2010-07-07 19:45:26 +0000
+++ libdbusmenu-glib/client.c 2010-07-14 14:06:44 +0000
@@ -716,6 +716,17 @@
void
dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name, const GValue * value, guint timestamp)
{
+ g_return_if_fail(DBUSMENU_IS_CLIENT(client));
+ g_return_if_fail(id >= 0);
+ g_return_if_fail(name != NULL);
+
+ if (value == NULL) {
+ GValue internalval = {0};
+ g_value_init(&internalval, G_TYPE_INT);
+ g_value_set_int(&internalval, 0);
+ value = &internalval;
+ }
+
DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
org_ayatana_dbusmenu_event_async (priv->menuproxy, id, name, value, timestamp, menuitem_call_cb, GINT_TO_POINTER(id));
return;
Follow ups