libpurple/protocols/yahoo/yahoo_packet.c

branch
release-2.2.3
changeset 20286
629c12d9254c
parent 19859
71d37b57eff2
child 21503
b3cad646ba4a
--- a/libpurple/protocols/yahoo/yahoo_packet.c	Thu Nov 01 20:30:44 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_packet.c	Fri Nov 09 08:32:29 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