From 80467be5780000e124f23a0f3d799b0618929eda Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 29 Mar 2011 15:08:05 +0100 Subject: [PATCH 3/5] dbus_g_proxy_set_interface: check that it's a proxy and not destroyed If it has emitted destroy, our use of priv->manager will be a NULL pointer dereference. --- dbus/dbus-gproxy.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c index 9686bd2..46d594d 100644 --- a/dbus/dbus-gproxy.c +++ b/dbus/dbus-gproxy.c @@ -2128,12 +2128,17 @@ dbus_g_proxy_get_interface (DBusGProxy *proxy) * @interface_name: an object interface * * Sets the object interface proxy is bound to + * + * It is an error to call this method on a proxy that has emitted + * the #DBusGProxy::destroy signal. */ void dbus_g_proxy_set_interface (DBusGProxy *proxy, const char *interface_name) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); + g_return_if_fail (DBUS_IS_G_PROXY (proxy)); + g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); /* FIXME - need to unregister when we switch interface for now * later should support idea of unset interface */ -- 1.7.4.1