# HG changeset patch # User Marcus Lundblad # Date 1251749254 0 # Node ID 191bb5bf2fc514161b0a24f3510abb13ec5411cd # Parent 86e6df9a0c8048cfa5b672ecaa865df1acca455d Don't crash when receiving an error iq response when trying fetch a custom smiley (will happen if a client not supporting BoB sends XHTML-IM containing cid: images). Thanks to Florob, Waqas and Darkrain for finding and hinting about this :) diff -r 86e6df9a0c80 -r 191bb5bf2fc5 ChangeLog --- a/ChangeLog Mon Aug 31 16:12:03 2009 +0000 +++ b/ChangeLog Mon Aug 31 20:07:34 2009 +0000 @@ -18,6 +18,8 @@ properly. In addition, it is no longer possible to add buddies of the form "room@conference.example.net/User", where room@conference.example.net is a MUC. + * Don't crash when receiving "smileyfied" XHTML-IM from clients that don't + support bits of binary (ie. when getting an empty in return) Yahoo!/Yahoo! JAPAN: * Accounts now have "Use account proxy for SSL connections" option. This diff -r 86e6df9a0c80 -r 191bb5bf2fc5 libpurple/protocols/jabber/data.c --- a/libpurple/protocols/jabber/data.c Mon Aug 31 16:12:03 2009 +0000 +++ b/libpurple/protocols/jabber/data.c Mon Aug 31 20:07:34 2009 +0000 @@ -77,6 +77,13 @@ data->type = g_strdup(xmlnode_get_attrib(tag, "type")); raw_data = xmlnode_get_data(tag); + + if (raw_data == NULL) { + purple_debug_error("jabber", "data element was empty"); + g_free(data); + return NULL; + } + data->data = purple_base64_decode(raw_data, &size); data->size = size; diff -r 86e6df9a0c80 -r 191bb5bf2fc5 libpurple/protocols/jabber/message.c --- a/libpurple/protocols/jabber/message.c Mon Aug 31 16:12:03 2009 +0000 +++ b/libpurple/protocols/jabber/message.c Mon Aug 31 20:07:34 2009 +0000 @@ -493,7 +493,7 @@ xmlnode *item_not_found = xmlnode_get_child(packet, "item-not-found"); /* did we get a data element as result? */ - if (data_element) { + if (data_element && type == JABBER_IQ_RESULT) { JabberData *data = jabber_data_create_from_xml(data_element); if (data) {