diff libpurple/protocols/yahoo/yahoo_packet.c @ 21284:6de09629f091

propagate from branch 'im.pidgin.pidgin.next.minor' (head 0c9637482b845cc65e95a26e144697391c51133f) to branch 'im.pidgin.pidgin' (head e3a6991e78dac328f13804950fee54dfb8afc3c5)
author Ka-Hing Cheung <khc@hxbc.us>
date Sat, 10 Nov 2007 04:52:20 +0000
parents bc34e9806879
children 38cc722159ff
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo_packet.c	Sat Nov 10 01:18:15 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_packet.c	Sat Nov 10 04:52:20 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) */