From 042406a84a19568ab4e417e51eac9a632970c25e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 4 Apr 2012 23:06:45 -0500 Subject: Protect from the cases where we might get NULL in the data segment --- libdbusmenu-glib/client.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 34f8b8d..78537f8 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1834,6 +1834,8 @@ struct _about_to_show_t { static void about_to_show_finish (about_to_show_t * data, gboolean need_update) { + g_return_if_fail(data != NULL); + /* If we need to update, do that first. */ if (need_update) { update_layout(data->client); @@ -1938,6 +1940,8 @@ about_to_show_idle (gpointer user_data) GQueue * showers = priv->about_to_show_to_go; priv->about_to_show_to_go = NULL; + g_return_val_if_fail(showers != NULL, FALSE); + /* Figure out if we've got any callbacks */ gboolean got_callbacks = FALSE; g_queue_foreach(showers, about_to_show_idle_callbacks, &got_callbacks); @@ -1995,7 +1999,10 @@ about_to_show_cb (GObject * proxy, GAsyncResult * res, gpointer userdata) g_variant_unref(params); } - about_to_show_finish(data, need_update); + if (data != NULL) { + about_to_show_finish(data, need_update); + } + return; } -- cgit v1.2.3 From 9e5453bb93db68695d5fd4c1e8de8003a400f7d6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 4 Apr 2012 23:07:16 -0500 Subject: Make sure that if the callback is NULL we're not trying to get a callback --- libdbusmenu-glib/client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 78537f8..ed89d86 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -2035,11 +2035,15 @@ dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, void (*cb)( priv->about_to_show_idle = g_idle_add(about_to_show_idle, client); } } else { + GAsyncReadyCallback dbuscb = NULL; + /* If there's no callback we don't need this data, let's clean it up in a consistent way */ if (cb == NULL) { about_to_show_finish(data, FALSE); data = NULL; + } else { + dbuscb = about_to_show_cb; } g_dbus_proxy_call(priv->menuproxy, @@ -2048,7 +2052,7 @@ dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, void (*cb)( G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ NULL, /* cancellable */ - about_to_show_cb, + dbuscb, data); } -- cgit v1.2.3 From 02a14f6b93bec06f7dc73dd6e93e691e0d254ca1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 5 Apr 2012 10:35:53 -0500 Subject: 0.5.98 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 2d51716..a1f269b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.5.97, ted@canonical.com) +AC_INIT(libdbusmenu, 0.5.98, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.5.97, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.5.98, [-Wno-portability]) AM_MAINTAINER_MODE -- cgit v1.2.3