diff options
Diffstat (limited to 'libpurple')
-rw-r--r-- | libpurple/protocols/jabber/data.c | 7 | ||||
-rw-r--r-- | libpurple/protocols/jabber/message.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libpurple/protocols/jabber/data.c b/libpurple/protocols/jabber/data.c index fe2fd7ed98..61d5eca3d2 100644 --- a/libpurple/protocols/jabber/data.c +++ b/libpurple/protocols/jabber/data.c @@ -77,6 +77,13 @@ jabber_data_create_from_xml(xmlnode *tag) 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 --git a/libpurple/protocols/jabber/message.c b/libpurple/protocols/jabber/message.c index 6b11259a65..9fac494f40 100644 --- a/libpurple/protocols/jabber/message.c +++ b/libpurple/protocols/jabber/message.c @@ -493,7 +493,7 @@ jabber_message_get_data_cb(JabberStream *js, const char *from, 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) { |