# HG changeset patch # User Ka-Hing Cheung # Date 1193632870 0 # Node ID bc34e9806879561dec2a8c16f10083ae9f69f69a # Parent f710e48fbe1b57fa5c0f6f33800343a5a53352b3 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 diff -r f710e48fbe1b -r bc34e9806879 libpurple/protocols/yahoo/yahoo_packet.c --- 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) */