im.pidgin.pidgin: 7ea551cdfc72cb2ec310d0d54d2a7e5badf7535e

khc at pidgin.im khc at pidgin.im
Mon Oct 29 00:45:40 EDT 2007


-----------------------------------------------------------------
Revision: 7ea551cdfc72cb2ec310d0d54d2a7e5badf7535e
Ancestor: 1d36a128301cae57a790a087aa9c4ad8d71dad52
Author: khc at pidgin.im
Date: 2007-10-29T04:41:10
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/yahoo/yahoo_packet.c

ChangeLog: 

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




-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo_packet.c	cb6d13aad2b6f48eb92d2ae45940dd52a5cf2d15
+++ libpurple/protocols/yahoo/yahoo_packet.c	4e9ef698e4c7088c88e9e3563513f6d1544adde9
@@ -174,8 +174,7 @@ void yahoo_packet_read(struct yahoo_pack
 		}
 
 		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) */


More information about the Commits mailing list