Sat, 02 May 2009 21:11:02 +0000
*** 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.
| libpurple/protocols/jabber/jabber.c | file | annotate | diff | comparison | revisions |
--- 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, '<');