comparison libpurple/protocols/oscar/family_locate.c @ 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 ce3c8d30a200
comparison
equal deleted inserted replaced
18616:c3c610e73fc0 18617:f79b6bb6bb5f
812 * kind of like an away message, but you're not away 812 * kind of like an away message, but you're not away
813 * (it's called an "available" message). Or it can 813 * (it's called an "available" message). Or it can
814 * contain information about the buddy icon the user 814 * contain information about the buddy icon the user
815 * has stored on the server. 815 * has stored on the server.
816 */ 816 */
817 int type2, number, length2; 817 guint16 type2;
818 guint8 number, length2;
819 int endpos2;
818 820
819 /* 821 /*
820 * Continue looping as long as we're able to read type2, 822 * Continue looping as long as we're able to read type2,
821 * number, and length2. 823 * number, and length2.
822 */ 824 */
823 while (byte_stream_curpos(bs) + 4 <= endpos) { 825 while (byte_stream_curpos(bs) + 4 <= endpos) {
824 type2 = byte_stream_get16(bs); 826 type2 = byte_stream_get16(bs);
825 number = byte_stream_get8(bs); 827 number = byte_stream_get8(bs);
826 length2 = byte_stream_get8(bs); 828 length2 = byte_stream_get8(bs);
829
830 endpos2 = byte_stream_curpos(bs) + length2;
827 831
828 switch (type2) { 832 switch (type2) {
829 case 0x0000: { /* This is an official buddy icon? */ 833 case 0x0000: { /* This is an official buddy icon? */
830 /* This is always 5 bytes of "0x02 01 d2 04 72"? */ 834 /* This is always 5 bytes of "0x02 01 d2 04 72"? */
831 byte_stream_advance(bs, length2); 835 byte_stream_advance(bs, length2);
881 outinfo->itmsurl_len = 0; 885 outinfo->itmsurl_len = 0;
882 outinfo->itmsurl = g_strdup(""); 886 outinfo->itmsurl = g_strdup("");
883 outinfo->itmsurl_encoding = NULL; 887 outinfo->itmsurl_encoding = NULL;
884 } 888 }
885 } break; 889 } break;
886
887 default: {
888 byte_stream_advance(bs, length2);
889 } break;
890 } 890 }
891
892 /* Save ourselves. */
893 byte_stream_setpos(bs, endpos2);
891 } 894 }
892 895
893 } else if (type == 0x001e) { 896 } else if (type == 0x001e) {
894 /* 897 /*
895 * Always four bytes, but it doesn't look like an int. 898 * Always four bytes, but it doesn't look like an int.