# HG changeset patch # User Mark Doliner # Date 1185256397 0 # Node ID 9eb399e7cacd7ae0fa2f9da690d4c4e658971f31 # Parent f05360b5470d0211034118ff83461ca33c513be8# Parent c3c610e73fc014902f434ae282ab1f67f26bfee6 merge of '3c06e81a006adebe420915ad7301ad1e6e82cab8' and '67e1f549a2e9873164401a7d188d208d670deac1' diff -r f05360b5470d -r 9eb399e7cacd libpurple/protocols/oscar/family_locate.c --- a/libpurple/protocols/oscar/family_locate.c Tue Jul 24 03:52:21 2007 +0000 +++ b/libpurple/protocols/oscar/family_locate.c Tue Jul 24 05:53:17 2007 +0000 @@ -816,7 +816,11 @@ */ int type2, number, length2; - while (byte_stream_curpos(bs) < endpos) { + /* + * Continue looping as long as we're able to read type2, + * number, and length2. + */ + while (byte_stream_curpos(bs) + 4 <= endpos) { type2 = byte_stream_get16(bs); number = byte_stream_get8(bs); length2 = byte_stream_get8(bs);