From d9eadad52f3df0bafb77ba2710da5f58e8033e08 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 21 May 2014 10:50:40 +0200 Subject: [PATCH 5/9] ensure that values received from callback are not NULL Make clang happier and is safer anyway. https://bugs.freedesktop.org/show_bug.cgi?id=79006 --- telepathy-glib/account.c | 2 ++ telepathy-glib/base-room-config.c | 2 ++ telepathy-glib/connection.c | 2 ++ telepathy-glib/debug-client.c | 2 ++ telepathy-glib/gnio-util.c | 2 ++ 5 files changed, 10 insertions(+) diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 8fd7c55..76f39ba 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -3313,6 +3313,8 @@ _tp_account_got_avatar_cb (TpProxy *proxy, { GTask *task = user_data; + g_return_if_fail (out_Value); + if (error != NULL) { DEBUG ("Failed to get avatar: %s", error->message); diff --git a/telepathy-glib/base-room-config.c b/telepathy-glib/base-room-config.c index 1973b97..8055068 100644 --- a/telepathy-glib/base-room-config.c +++ b/telepathy-glib/base-room-config.c @@ -759,6 +759,8 @@ validate_property_type ( static TpDBusPropertiesMixinIfaceInfo *iface_info = NULL; TpDBusPropertiesMixinPropInfo *prop_info; + g_return_val_if_fail (value != NULL, FALSE); + if (G_UNLIKELY (iface_info == NULL)) iface_info = tp_svc_interface_get_dbus_properties_info ( TP_TYPE_SVC_CHANNEL_INTERFACE_ROOM_CONFIG1); diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 93c1a11..dac7fbb 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -515,6 +515,8 @@ tp_connection_get_rcc_cb (TpProxy *proxy, TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; + g_return_if_fail (value != NULL); + if (error != NULL) { DEBUG ("Failed to get RequestableChannelClasses property, using an " diff --git a/telepathy-glib/debug-client.c b/telepathy-glib/debug-client.c index 4eb2811..9f3ab22 100644 --- a/telepathy-glib/debug-client.c +++ b/telepathy-glib/debug-client.c @@ -268,6 +268,8 @@ got_enabled_cb ( { TpDebugClient *self = TP_DEBUG_CLIENT (proxy); + g_return_if_fail (value != NULL); + if (error != NULL) { tp_proxy_invalidate (proxy, error); diff --git a/telepathy-glib/gnio-util.c b/telepathy-glib/gnio-util.c index d3d5f73..994428c 100644 --- a/telepathy-glib/gnio-util.c +++ b/telepathy-glib/gnio-util.c @@ -82,6 +82,8 @@ tp_g_socket_address_from_variant (TpSocketAddressType type, { GSocketAddress *addr; + g_return_val_if_fail (variant != NULL, NULL); + switch (type) { #ifdef HAVE_GIO_UNIX -- 1.9.0