Another stab at fixing that signon infinite loop

Tue, 24 Jul 2007 06:57:38 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Tue, 24 Jul 2007 06:57:38 +0000
changeset 18914
bdcc8939807b
parent 18913
61c4ca4f733a
child 18916
1a9971455360

Another stab at fixing that signon infinite loop

libpurple/protocols/oscar/family_locate.c file | annotate | diff | comparison | revisions
--- 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) {

mercurial