[Telepathy] [PATCH] fix segfault in got_contact_list_attributes_cb

Maksim Melnikau maxposedon at gmail.com
Sat Jan 5 15:01:00 PST 2013


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 at gmail.com>
---
 telepathy-glib/connection-contact-list.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/telepathy-glib/connection-contact-list.c b/telepathy-glib/connection-contact-list.c
index 4d53dfe..2864882 100644
--- a/telepathy-glib/connection-contact-list.c
+++ b/telepathy-glib/connection-contact-list.c
@@ -255,6 +255,8 @@ got_contact_list_attributes_cb (TpConnection *self,
 
       contact = tp_simple_client_factory_ensure_contact (
           tp_proxy_get_factory (self), self, handle, id);
+      if (!contact)
+         continue;
       if (!_tp_contact_set_attributes (contact, value,
               features->len, (TpContactFeature *) features->data, &e))
         {
-- 
1.8.1



More information about the telepathy mailing list