Mercurial > pidgin
changeset 25759:69cf692c09f5
Fix error handling on missing "seq" attribute
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Tue, 16 Dec 2008 21:46:06 +0000 |
parents | b535b9ffb929 |
children | fd5465db9b89 |
files | libpurple/protocols/jabber/ibb.c |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/ibb.c Tue Dec 16 19:18:41 2008 +0000 +++ b/libpurple/protocols/jabber/ibb.c Tue Dec 16 21:46:06 2008 +0000 @@ -395,12 +395,11 @@ "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);