changeset 22529:eee94c5446a9

If the default value of a list-single or list-multi data forms field is NULL (<value/> or <value></value>) don't stick NULL in the selected list (this will crash in the g_list_find_custom call later).
author Etan Reisner <pidgin@unreliablesource.net>
date Thu, 20 Mar 2008 02:59:50 +0000
parents 4bcd3868a136
children 1ad74db7efa8
files ChangeLog libpurple/protocols/jabber/xdata.c
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Mar 19 05:06:14 2008 +0000
+++ b/ChangeLog	Thu Mar 20 02:59:50 2008 +0000
@@ -16,6 +16,7 @@
 	* Fix a crash when starting if you have a Zephyr account
 	* Increase XMPP ping timeout to 120 seconds, to prevent poor network
 	  connections from timing out unnecessarily.
+	* Don't crash on XMPP forms with empty default values.
 
 	Pidgin:
 	* Remove a workaround for older versions gstreamer that was causing
--- a/libpurple/protocols/jabber/xdata.c	Wed Mar 19 05:06:14 2008 +0000
+++ b/libpurple/protocols/jabber/xdata.c	Thu Mar 20 02:59:50 2008 +0000
@@ -285,7 +285,10 @@
 
 			for(valuenode = xmlnode_get_child(fn, "value"); valuenode;
 					valuenode = xmlnode_get_next_twin(valuenode)) {
-				selected = g_list_prepend(selected, xmlnode_get_data(valuenode));
+				char *data = xmlnode_get_data(valuenode);
+				if (data != NULL) {
+					selected = g_list_prepend(selected, data);
+				}
 			}
 
 			for(optnode = xmlnode_get_child(fn, "option"); optnode;