# HG changeset patch # User Ka-Hing Cheung # Date 1193640353 0 # Node ID 8b81eeaf9bcbc5da81866776f9308619b0318587 # Parent 9f0e2db39bc56d116aa0331bcad4453867daab7e# Parent fe1b44022884c45fb9a96338760978e254508e5f merge of '5e40b4c4c0c2949025f174c4aef2da0c54d79c31' and '886ce0e2c644e00427871777bb58888fbb8035cd' diff -r fe1b44022884 -r 8b81eeaf9bcb libpurple/protocols/yahoo/yahoo_packet.c --- a/libpurple/protocols/yahoo/yahoo_packet.c Mon Oct 29 04:08:42 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_packet.c Mon Oct 29 06:45:53 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) */