pidgin: b786784e: Prevent a buggy XMPP-raw plugin from cau...
datallah at pidgin.im
datallah at pidgin.im
Sat May 2 14:50:21 EDT 2009
-----------------------------------------------------------------
Revision: b786784e702c7cc7da7894e0de379cdaf56598c2
Ancestor: caff038902b2bfe825a66afcd5d46df9a181b043
Author: datallah at pidgin.im
Date: 2009-05-02T18:42:53
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b786784e702c7cc7da7894e0de379cdaf56598c2
Modified files:
libpurple/protocols/jabber/jabber.c
ChangeLog:
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.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c 49078c6a88b3034cce8461eb890c7c0bd16b2d5b
+++ libpurple/protocols/jabber/jabber.c 7ba3d9add3d6891dcc30abd8006991ec0f8823be
@@ -383,6 +383,11 @@ void jabber_send_raw(JabberStream *js, c
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, '<');
More information about the Commits
mailing list