[Telepathy] [Bug 19101] tp_connection_get_contacts_by_id() crashes

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 7 08:53:24 PST 2009


http://bugs.freedesktop.org/show_bug.cgi?id=19101


Will Thompson <will.thompson at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #9 from Will Thompson <will.thompson at collabora.co.uk>  2009-01-07 08:53:24 PST ---
commit d7d571e73817aa5b889f80c7185c89702d9c2f58
Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Wed Jan 7 15:51:13 2009 +0000

    Don't treat requested IDs' NULL terminator as an id.

    Fixes fd.o bug #19101
---
 telepathy-glib/contact.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 9e19d64..faf99ec 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -796,7 +796,8 @@ contacts_context_fail (ContactsContext *c,
           error, c->user_data, c->weak_object);
       return;
     case CB_BY_ID:
-      for (i = 0; i < c->request_ids->len; i++)
+      /* -1 because NULL terminator is explicit */
+      for (i = 0; i < c->request_ids->len - 1; i++)
         {
           const gchar *id = g_ptr_array_index (c->request_ids, i);


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Telepathy mailing list