# HG changeset patch # User Ka-Hing Cheung # Date 1193632879 0 # Node ID 9f0e2db39bc56d116aa0331bcad4453867daab7e # Parent bc34e9806879561dec2a8c16f10083ae9f69f69a# Parent ecaa34fd04731a0fa284ac0f4eea4e22eae98e4e merge of '7ea551cdfc72cb2ec310d0d54d2a7e5badf7535e' and 'c630ec53bad2efe91357c6f37e705fbb1562d4ae' diff -r ecaa34fd0473 -r 9f0e2db39bc5 libpurple/protocols/yahoo/yahoo_packet.c --- a/libpurple/protocols/yahoo/yahoo_packet.c Mon Oct 29 03:10:31 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_packet.c Mon Oct 29 04:41:19 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) */