From: <the...@us...> - 2006-08-13 05:50:21
|
Revision: 16732 Author: thekingant Date: 2006-08-12 22:50:19 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16732&view=rev Log Message: ----------- 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? Modified Paths: -------------- trunk/src/protocols/jabber/buddy.c Modified: trunk/src/protocols/jabber/buddy.c =================================================================== --- trunk/src/protocols/jabber/buddy.c 2006-08-13 05:22:33 UTC (rev 16731) +++ trunk/src/protocols/jabber/buddy.c 2006-08-13 05:50:19 UTC (rev 16732) @@ -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"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |