changeset 18617:f79b6bb6bb5f

Another stab at fixing that signon infinite loop
author Mark Doliner <mark@kingant.net>
date Tue, 24 Jul 2007 06:57:38 +0000
parents c3c610e73fc0
children 1b032e320dbf
files libpurple/protocols/oscar/family_locate.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_locate.c	Sun Jul 22 22:08:13 2007 +0000
+++ b/libpurple/protocols/oscar/family_locate.c	Tue Jul 24 06:57:38 2007 +0000
@@ -814,7 +814,9 @@
 			 * contain information about the buddy icon the user
 			 * has stored on the server.
 			 */
-			int type2, number, length2;
+			guint16 type2;
+			guint8 number, length2;
+			int endpos2;
 
 			/*
 			 * Continue looping as long as we're able to read type2,
@@ -825,6 +827,8 @@
 				number = byte_stream_get8(bs);
 				length2 = byte_stream_get8(bs);
 
+				endpos2 = byte_stream_curpos(bs) + length2;
+
 				switch (type2) {
 					case 0x0000: { /* This is an official buddy icon? */
 						/* This is always 5 bytes of "0x02 01 d2 04 72"? */
@@ -883,11 +887,10 @@
 							outinfo->itmsurl_encoding = NULL;
 						}
 					} break;
+				}
 
-					default: {
-						byte_stream_advance(bs, length2);
-					} break;
-				}
+				/* Save ourselves. */
+				byte_stream_setpos(bs, endpos2);
 			}
 
 		} else if (type == 0x001e) {