--- 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) */