cpw.malu.xmpp.ibb_ft: 5a20d975: Fix error handling on missing "seq" attr...

malu at pidgin.im malu at pidgin.im
Tue Dec 16 16:50:31 EST 2008


-----------------------------------------------------------------
Revision: 5a20d975b44d4f6a1cefe00a04c5a57b2094d727
Ancestor: ed2dea43720abe02c975808024aee3624299edc9
Author: malu at pidgin.im
Date: 2008-12-16T21:46:06
Branch: im.pidgin.cpw.malu.xmpp.ibb_ft
URL: http://d.pidgin.im/viewmtn/revision/info/5a20d975b44d4f6a1cefe00a04c5a57b2094d727

Modified files:
        libpurple/protocols/jabber/ibb.c

ChangeLog: 

Fix error handling on missing "seq" attribute

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/ibb.c	7886d3adb8b89894c2424858bf1727812f5d45db
+++ libpurple/protocols/jabber/ibb.c	5f9c0fe4b30004d88ea8499a6ed3c68fa7d95bdc
@@ -395,12 +395,11 @@ jabber_ibb_parse(JabberStream *js, xmlno
 				"Got IBB iq from wrong JID, ignoring\n");
 		} else if (data) {
 			const gchar *seq_attr = xmlnode_get_attrib(data, "seq");
-			guint16 seq = 0;
+			guint16 seq = (seq_attr ? atoi(seq_attr) : 0);
 
 			/* reject the data, and set the session in error if we get an
 			  out-of-order packet */
-			if (seq_attr && (seq = atoi(seq_attr)) &&
-					seq == jabber_ibb_session_get_recv_seq(sess)) {
+			if (seq_attr && seq == jabber_ibb_session_get_recv_seq(sess)) {
 				/* sequence # is the expected... */
 				JabberIq *result = jabber_iq_new(js, JABBER_IQ_RESULT);
 				


More information about the Commits mailing list