summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Melnikau <maxposedon@gmail.com>2013-01-06 02:01:00 +0300
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-01-07 11:48:36 +0000
commitbc691e42d9e55ce6fe5030f898b8166b7e44d90b (patch)
tree8229bd4cb6d021c48b8c81f59c6407af7f972bf3
parent08de9efcd7295f50d0883f048abfd00f3974502c (diff)
downloadtelepathy-glib-bc691e42d9e55ce6fe5030f898b8166b7e44d90b.tar.gz
fix segfault in got_contact_list_attributes_cb
tp_simple_client_factory_ensure_contact returns NULL for protocols, if tp_connection_has_immortal_handles=0. Right now its happened for any telepathy-python based protocols (butterfly, sunsine, mixer). when tp_simple_client_factory_ensure_contact returns NULL, tp_simple_client_factory_ensure_contact just segfault in _tp_contact_set_attributes. lets assume that contact sometimes NULL here, and skip them Signed-off-by: Maksim Melnikau <maxposedon@gmail.com> [edited for coding style, added a comment -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--telepathy-glib/connection-contact-list.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/telepathy-glib/connection-contact-list.c b/telepathy-glib/connection-contact-list.c
index ae6d0890e..b2efc2503 100644
--- a/telepathy-glib/connection-contact-list.c
+++ b/telepathy-glib/connection-contact-list.c
@@ -259,6 +259,12 @@ got_contact_list_attributes_cb (TpConnection *self,
contact = tp_simple_client_factory_ensure_contact (
tp_proxy_get_factory (self), self, handle, id);
+
+ /* ensure_contact() can fail for obsolete CMs that don't have
+ * ImmortalHandles */
+ if (contact == NULL)
+ continue;
+
if (!_tp_contact_set_attributes (contact, value,
features->len, (TpContactFeature *) features->data, &e))
{