# HG changeset patch # User Daniel Atallah # Date 1241289773 0 # Node ID 93bf089e623361c0420009429725a92a133fb336 # Parent 19d27ee1c72a5fdf2f2057e3f6e9205c702b3b52 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. diff -r 19d27ee1c72a -r 93bf089e6233 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Sat May 02 18:19:55 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sat May 02 18:42:53 2009 +0000 @@ -383,6 +383,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, '<');