# HG changeset patch # User Mark Doliner # Date 1155448219 0 # Node ID 14e14f1ef1d8e3f7147b64d7ed3d73dcc952ce9d # Parent a63358a0093e359ce8e6174db86ed0521d020f26 [gaim-migrate @ 16732] Jabber crashed when getting info from someone on your buddy list if the JID consists only of the domain identifer. For example, add "quser.alpha.qunu.com" to your buddy list then get their info. This fixes the crashing. I'm not really sure if the fix is correct. Can someone familiar with Jabber please look over this? committer: Tailor Script diff -r a63358a0093e -r 14e14f1ef1d8 src/protocols/jabber/buddy.c --- a/src/protocols/jabber/buddy.c Sun Aug 13 05:22:33 2006 +0000 +++ b/src/protocols/jabber/buddy.c Sun Aug 13 05:50:19 2006 +0000 @@ -1119,15 +1119,20 @@ for(resources = jb->resources; resources; resources = resources->next) { JabberBuddyResource *jbr = resources->data; - JabberBuddyInfoResource *jbir = g_new0(JabberBuddyInfoResource, 1); + JabberBuddyInfoResource *jbir; char *full_jid; - if(strrchr(jid, '/')) { + + if ((strchr(jid, '/') == NULL) && (jbr->name != NULL)) { + full_jid = g_strdup_printf("%s/%s", jid, jbr->name); + } else { full_jid = g_strdup(jid); - } else { - full_jid = g_strdup_printf("%s/%s", jid, jbr->name); } - g_hash_table_insert(jbi->resources, g_strdup(jbr->name), jbir); + if (jbr->name != NULL) + { + jbir = g_new0(JabberBuddyInfoResource, 1); + g_hash_table_insert(jbi->resources, g_strdup(jbr->name), jbir); + } if(!jbr->client.name) { iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:version");