# HG changeset patch # User Mark Doliner # Date 1185142093 0 # Node ID c3c610e73fc014902f434ae282ab1f67f26bfee6 # Parent 0ad0bdb0063b766bf47d67aab1e2e9cbbd4ca8c1 I'm hoping this will fix a semi-random and semi-random infinite looping bug when parsing buddy info in oscar. Maybe only for ICQ. We've been seeing this at meebo a lot the past three weeks or so. References #2078. diff -r 0ad0bdb0063b -r c3c610e73fc0 libpurple/protocols/oscar/family_locate.c --- a/libpurple/protocols/oscar/family_locate.c Sun Jul 22 18:17:26 2007 +0000 +++ b/libpurple/protocols/oscar/family_locate.c Sun Jul 22 22:08:13 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);