changeset 28159:087ad09cd4f5

merge of '5fabe3309f53afaf46157b615ec20eec581969e5' and 'fd5955618eddcd84d522b30ff11102f9601f38c8'
author Paul Aurich <paul@darkrain42.org>
date Mon, 31 Aug 2009 20:10:35 +0000
parents 02c62c9ad822 (current diff) 191bb5bf2fc5 (diff)
children 40d8427d1813 196e4c5b2043
files libpurple/protocols/jabber/data.c
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Aug 31 20:07:36 2009 +0000
+++ b/ChangeLog	Mon Aug 31 20:10:35 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 <data/> in return)
 
 	Yahoo!/Yahoo! JAPAN:
 	* Accounts now have "Use account proxy for SSL connections" option.  This
--- a/libpurple/protocols/jabber/data.c	Mon Aug 31 20:07:36 2009 +0000
+++ b/libpurple/protocols/jabber/data.c	Mon Aug 31 20:10:35 2009 +0000
@@ -75,6 +75,13 @@
 	}
 
 	raw_data = xmlnode_get_data(tag);
+
+	if (raw_data == NULL) {
+		purple_debug_error("jabber", "data element was empty");
+		g_free(data);
+		return NULL;
+	}
+
 	if (raw_data == NULL || *raw_data == '\0') {
 		g_free(raw_data);
 		return NULL;
--- a/libpurple/protocols/jabber/message.c	Mon Aug 31 20:07:36 2009 +0000
+++ b/libpurple/protocols/jabber/message.c	Mon Aug 31 20:10:35 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) {