changeset 18627:9eb399e7cacd

merge of '3c06e81a006adebe420915ad7301ad1e6e82cab8' and '67e1f549a2e9873164401a7d188d208d670deac1'
author Mark Doliner <mark@kingant.net>
date Tue, 24 Jul 2007 05:53:17 +0000
parents f05360b5470d (current diff) c3c610e73fc0 (diff)
children 1b032e320dbf
files
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);