changeset 25884:b9a90f34b780

*** Plucked rev b786784e (datallah@pidgin.im): Prevent a buggy XMPP-raw plugin from causing a NUL ptr deref - instead the debug output may be slightly mangled. This came out of the veracode analysis.
author Paul Aurich <paul@darkrain42.org>
date Sat, 02 May 2009 21:11:02 +0000
parents 9931796e1765
children c56debe9ae4f 1a1765a87336
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sat May 02 21:09:37 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sat May 02 21:11:02 2009 +0000
@@ -376,6 +376,11 @@
 			char *data_start, *tag_end = strchr(tag_start, '>');
 			text = g_strdup(data);
 
+			/* Better to print out some wacky debugging than crash
+			 * due to a plugin sending bad xml */
+			if (tag_end == NULL)
+				tag_end = tag_start;
+
 			data_start = text + (tag_end - data) + 1;
 
 			last_part = strchr(data_start, '<');