Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/tlv.c

    rfbc7844 rb7d3cc34  
    11#include <aim.h>
    22
     3static aim_tlv_t *createtlv(void)
     4{
     5        return g_new0(aim_tlv_t, 1);
     6}
     7
    38static void freetlv(aim_tlv_t **oldtlv)
    49{
     10
    511        if (!oldtlv || !*oldtlv)
    612                return;
     
    915        g_free(*oldtlv);
    1016        *oldtlv = NULL;
     17
     18        return;
    1119}
    1220
     
    3846                length = aimbs_get16(bs);
    3947
    40                 cur = g_new0(aim_tlvlist_t, 1);
    41 
    42                 cur->tlv = g_new0(aim_tlv_t, 1);
    43                 cur->tlv->type = type;
    44                 if ((cur->tlv->length = length))
    45                         cur->tlv->value = aimbs_getraw(bs, length);     
    46 
    47                 cur->next = list;
    48                 list = cur;
     48#if 0 /* temporarily disabled until I know if they're still doing it or not */
     49                /*
     50                 * Okay, so now AOL has decided that any TLV of
     51                 * type 0x0013 can only be two bytes, despite
     52                 * what the actual given length is.  So here
     53                 * we dump any invalid TLVs of that sort.  Hopefully
     54                 * theres no special cases to this special case.
     55                 *   - mid (30jun2000)
     56                 */
     57                if ((type == 0x0013) && (length != 0x0002))
     58                        length = 0x0002;
     59#else
     60                if (0)
     61                        ;
     62#endif
     63                else {
     64
     65                        cur = g_new0(aim_tlvlist_t, 1);
     66
     67                        cur->tlv = createtlv();
     68                        cur->tlv->type = type;
     69                        if ((cur->tlv->length = length))
     70                               cur->tlv->value = aimbs_getraw(bs, length);     
     71
     72                        cur->next = list;
     73                        list = cur;
     74                }
    4975        }
    5076
     
    147173                return 0;
    148174
    149         if (!(newtlv->tlv = g_new0(aim_tlv_t, 1))) {
     175        if (!(newtlv->tlv = createtlv())) {
    150176                g_free(newtlv);
    151177                return 0;
Note: See TracChangeset for help on using the changeset viewer.