another patch from Andrew Gaul, funny how it's been exactly a year since Mark

Mon, 29 Oct 2007 04:41:10 +0000

author
Ka-Hing Cheung <khc@pidgin.im>
date
Mon, 29 Oct 2007 04:41:10 +0000
changeset 21097
bb62b1e2c4dd
parent 21096
f19ca20f8d27
child 21118
45f6e1b510ef

another patch from Andrew Gaul, funny how it's been exactly a year since Mark
proposed the solution:

Invalid strstr call in yahoo_packet_read. Use g_strstr_len because
string is not NUL terminated. Same issue as:

https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1580769&group_id=235

libpurple/protocols/yahoo/yahoo_packet.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/yahoo/yahoo_packet.c	Fri Oct 26 05:24:14 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_packet.c	Mon Oct 29 04:41:10 2007 +0000
@@ -174,8 +174,7 @@
 		}
 
 		if (accept) {
-			/* TODO: strstr() should not be used here because data isn't NULL terminated */
-			delimiter = (const guchar *)strstr((char *)&data[pos], "\xc0\x80");
+			delimiter = (const guchar *)g_strstr_len((const char *)&data[pos], len - pos, "\xc0\x80");
 			if (delimiter == NULL)
 			{
 				/* Malformed packet! (It doesn't end in 0xc0 0x80) */

mercurial