- while (curtlv < tlvcnt)
- {
- curtype = aimutil_get16(&buf[i]);
- switch (curtype)
- {
- /*
- * Type = 0x0001: Member Class.
- *
- * Specified as any of the following bitwise ORed together:
- * 0x0001 Trial (user less than 60days)
- * 0x0002 Unknown bit 2
- * 0x0004 AOL Main Service user
- * 0x0008 Unknown bit 4
- * 0x0010 Free (AIM) user
- * 0x0020 Away
- *
- * In some odd cases, we can end up with more
- * than one of these. We only want the first,
- * as the others may not be something we want.
- *
- */
- case 0x0001:
- if (tlv1) /* use only the first */
- break;
- outinfo->class = aimutil_get16(&buf[i+4]);
- tlv1++;
- break;
-
- /*
- * Type = 0x0002: Member-Since date.
- *
- * The time/date that the user originally
- * registered for the service, stored in
- * time_t format
- */
- case 0x0002:
- outinfo->membersince = aimutil_get32(&buf[i+4]);
- break;
-
- /*
- * Type = 0x0003: On-Since date.
- *
- * The time/date that the user started
- * their current session, stored in time_t
- * format.
- */
- case 0x0003:
- outinfo->onlinesince = aimutil_get32(&buf[i+4]);
- break;
-
- /*
- * Type = 0x0004: Idle time.
- *
- * Number of seconds since the user
- * actively used the service.
- */
- case 0x0004:
- outinfo->idletime = aimutil_get16(&buf[i+4]);
- break;
-
- /*
- * Type = 0x000d
- *
- * Capability information. Not real sure of
- * actual decoding. See comment on aim_bos_setprofile()
- * in aim_misc.c about the capability block, its the same.
- *
- */
- case 0x000d:
- {
- int len;
- len = aimutil_get16(buf+i+2);
- if (!len)
- break;
-
- outinfo->capabilities = aim_getcap(buf+i+4, len);
- }
- break;
+ while (curtlv < tlvcnt) {
+ lastvalid = 1;
+ curtype = aimutil_get16(&buf[i]);
+ switch (curtype) {
+ /*
+ * Type = 0x0000: Invalid
+ *
+ * AOL has been trying to throw these in just to break us.
+ * They're real nice guys over there at AOL.
+ *
+ * Just skip the two zero bytes and continue on. (This doesn't
+ * count towards tlvcnt!)
+ */
+ case 0x0000:
+ lastvalid = 0;
+ i += 2;
+ break;