From 19176513584bf26fa69a8a946982d9c521038a17 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 3 Jun 2009 17:10:36 +0100 Subject: Fixed a bug that caused crashes when joining certain kinds of Google Talk chatrooms. Doesn't seem to be Google Talk specific, other than that this is the first time I see empty elements that cause this crash. A more proper/efficient fix may be to just move the break outside the inner if. --- protocols/jabber/conference.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'protocols/jabber') diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index 480006bd..08bef4f5 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -233,8 +233,10 @@ void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bu if( ( s = xt_find_attr( c, "xmlns" ) ) && ( strcmp( s, XMLNS_MUC_USER ) == 0 ) ) { - c = xt_find_node( c->children, "item" ); - if( ( s = xt_find_attr( c, "jid" ) ) ) + struct xt_node *item; + + item = xt_find_node( c->children, "item" ); + if( ( s = xt_find_attr( item, "jid" ) ) ) { /* Yay, found what we need. :-) */ bud->ext_jid = jabber_normalize( s ); -- cgit v1.2.3 From bdad4079b4bbc8209bf17c81cafbf699f8c6d90d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 4 Oct 2009 19:28:41 +0100 Subject: Fixing a crash bug that causes crashes only with buggy Jabber conference servers, sending a "you left this chat" without first acknowledging you entering it. --- protocols/jabber/conference.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'protocols/jabber') diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index 08bef4f5..f434c58a 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -284,12 +284,15 @@ void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bu } else if( type ) /* type can only be NULL or "unavailable" in this function */ { - s = strchr( bud->ext_jid, '/' ); - if( s ) *s = 0; - imcb_chat_remove_buddy( chat, bud->ext_jid, NULL ); - if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS ) - imcb_remove_buddy( ic, bud->ext_jid, NULL ); - if( s ) *s = '/'; + if( ( bud->flags & JBFLAG_IS_CHATROOM ) && bud->ext_jid ) + { + s = strchr( bud->ext_jid, '/' ); + if( s ) *s = 0; + imcb_chat_remove_buddy( chat, bud->ext_jid, NULL ); + if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS ) + imcb_remove_buddy( ic, bud->ext_jid, NULL ); + if( s ) *s = '/'; + } if( bud == jc->me ) jabber_chat_free( chat ); -- cgit v1.2.3 From 74349eb5b77e2143289ef98201d03870e0d2366a Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 17 Oct 2009 16:13:40 +0100 Subject: If you can't find what you expect in an IQ packet, it doesn't mean it's incorrect, so stop spamming. Ideally it should return a feature-not- implemented but I'll do that later. --- protocols/jabber/iq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'protocols/jabber') diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 38c5a5a9..875b5c81 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -50,10 +50,11 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data ) else if( strcmp( type, "get" ) == 0 ) { if( !( ( c = xt_find_node( node->children, "query" ) ) || - ( c = xt_find_node( node->children, "ping" ) ) ) || /* O_o WHAT is wrong with just ????? */ + ( c = xt_find_node( node->children, "ping" ) ) ) || !( s = xt_find_attr( c, "xmlns" ) ) ) { - imcb_log( ic, "Warning: Received incomplete IQ-%s packet", type ); + /* Sigh. Who decided to suddenly invent new elements + instead of just sticking with ? */ return XT_HANDLED; } -- cgit v1.2.3