comparison src/protocols/oscar/im.c @ 11253:7d31d61e6438

[gaim-migrate @ 13422] Get rid of faimdprintf and use gaim_debug functions instead committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 13 Aug 2005 06:43:45 +0000
parents bd8ac1d4b2f2
children 1b1d63602d77
comparison
equal deleted inserted replaced
11252:55356a29cdd1 11253:7d31d61e6438
1109 1109
1110 /* Channel ID */ 1110 /* Channel ID */
1111 channel = aimbs_get16(bs); 1111 channel = aimbs_get16(bs);
1112 1112
1113 if (channel != 0x01) { 1113 if (channel != 0x01) {
1114 faimdprintf(sess, 0, "icbm: ICBM recieved on unsupported channel. Ignoring. (chan = %04x)\n", channel); 1114 gaim_debug_misc("oscar", "icbm: ICBM recieved on unsupported channel. Ignoring. (chan = %04x)\n", channel);
1115 return 0; 1115 return 0;
1116 } 1116 }
1117 1117
1118 snlen = aimbs_get8(bs); 1118 snlen = aimbs_get8(bs);
1119 sn = aimbs_getstr(bs, snlen); 1119 sn = aimbs_getstr(bs, snlen);
1332 1332
1333 /* Message string length, including character set info. */ 1333 /* Message string length, including character set info. */
1334 msglen = aimbs_get16(&mbs); 1334 msglen = aimbs_get16(&mbs);
1335 if (msglen > aim_bstream_empty(&mbs)) 1335 if (msglen > aim_bstream_empty(&mbs))
1336 { 1336 {
1337 faimdprintf(sess, 0, "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.", userinfo->sn); 1337 gaim_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.", userinfo->sn);
1338 break; 1338 break;
1339 } 1339 }
1340 1340
1341 /* Character set info */ 1341 /* Character set info */
1342 flag1 = aimbs_get16(&mbs); 1342 flag1 = aimbs_get16(&mbs);
1432 type = aimbs_get16(bs); 1432 type = aimbs_get16(bs);
1433 length = aimbs_get16(bs); 1433 length = aimbs_get16(bs);
1434 1434
1435 if (length > aim_bstream_empty(bs)) 1435 if (length > aim_bstream_empty(bs))
1436 { 1436 {
1437 faimdprintf(sess, 0, "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn); 1437 gaim_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn);
1438 break; 1438 break;
1439 } 1439 }
1440 1440
1441 endpos = aim_bstream_curpos(bs) + length; 1441 endpos = aim_bstream_curpos(bs) + length;
1442 1442
1455 aimbs_get8(bs); /* 01 */ 1455 aimbs_get8(bs); /* 01 */
1456 1456
1457 args.featureslen = aimbs_get16(bs); 1457 args.featureslen = aimbs_get16(bs);
1458 if (args.featureslen > aim_bstream_empty(bs)) 1458 if (args.featureslen > aim_bstream_empty(bs))
1459 { 1459 {
1460 faimdprintf(sess, 0, "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn); 1460 gaim_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn);
1461 break; 1461 break;
1462 } 1462 }
1463 if (args.featureslen == 0) 1463 if (args.featureslen == 0)
1464 { 1464 {
1465 args.features = NULL; 1465 args.features = NULL;
1521 1521
1522 free(args.extdata); 1522 free(args.extdata);
1523 args.extdatalen = length; 1523 args.extdatalen = length;
1524 if (args.extdatalen > aim_bstream_empty(bs)) 1524 if (args.extdatalen > aim_bstream_empty(bs))
1525 { 1525 {
1526 faimdprintf(sess, 0, "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn); 1526 gaim_debug_misc("oscar", "Received an IM containing an invalid message part from %s. They are probably trying to do something malicious.\n", userinfo->sn);
1527 break; 1527 break;
1528 } 1528 }
1529 if (args.extdatalen == 0) 1529 if (args.extdatalen == 0)
1530 args.extdata = NULL; 1530 args.extdata = NULL;
1531 else 1531 else
1532 args.extdata = aimbs_getraw(bs, args.extdatalen); 1532 args.extdata = aimbs_getraw(bs, args.extdatalen);
1533 1533
1534 } else { 1534 } else {
1535 faimdprintf(sess, 0, "incomingim_ch1: unknown TLV 0x%04x (len %d)\n", type, length); 1535 gaim_debug_misc("oscar", "incomingim_ch1: unknown TLV 0x%04x (len %d)\n", type, length);
1536 } 1536 }
1537 1537
1538 /* 1538 /*
1539 * This is here to protect ourselves from ourselves. That 1539 * This is here to protect ourselves from ourselves. That
1540 * is, if something above doesn't completely parse its value 1540 * is, if something above doesn't completely parse its value
1593 char *bn; 1593 char *bn;
1594 1594
1595 bnlen = aimbs_get16(servdata); 1595 bnlen = aimbs_get16(servdata);
1596 bn = aimbs_getstr(servdata, bnlen); 1596 bn = aimbs_getstr(servdata, bnlen);
1597 1597
1598 faimdprintf(sess, 0, "got a buddy list from %s: group %s, buddy %s\n", userinfo->sn, gn, bn); 1598 gaim_debug_misc("oscar", "got a buddy list from %s: group %s, buddy %s\n", userinfo->sn, gn, bn);
1599 1599
1600 free(bn); 1600 free(bn);
1601 } 1601 }
1602 1602
1603 free(gn); 1603 free(gn);
1772 /* 1772 /*
1773 * Next comes the cookie. Should match the ICBM cookie. 1773 * Next comes the cookie. Should match the ICBM cookie.
1774 */ 1774 */
1775 cookie2 = aimbs_getraw(&bbs, 8); 1775 cookie2 = aimbs_getraw(&bbs, 8);
1776 if (memcmp(cookie, cookie2, 8) != 0) 1776 if (memcmp(cookie, cookie2, 8) != 0)
1777 faimdprintf(sess, 0, "rend: warning cookies don't match!\n"); 1777 gaim_debug_misc("oscar", "rend: warning cookies don't match!\n");
1778 memcpy(args.cookie, cookie2, 8); 1778 memcpy(args.cookie, cookie2, 8);
1779 free(cookie2); 1779 free(cookie2);
1780 1780
1781 /* 1781 /*
1782 * The next 16bytes are a capability block so we can 1782 * The next 16bytes are a capability block so we can
2067 tlvlist = aim_tlvlist_read(bs); 2067 tlvlist = aim_tlvlist_read(bs);
2068 ret = incomingim_ch4(sess, mod, rx, snac, channel, &userinfo, tlvlist, cookie); 2068 ret = incomingim_ch4(sess, mod, rx, snac, channel, &userinfo, tlvlist, cookie);
2069 aim_tlvlist_free(&tlvlist); 2069 aim_tlvlist_free(&tlvlist);
2070 2070
2071 } else { 2071 } else {
2072 faimdprintf(sess, 0, "icbm: ICBM received on an unsupported channel. Ignoring. (chan = %04x)\n", channel); 2072 gaim_debug_misc("oscar", "icbm: ICBM received on an unsupported channel. Ignoring. (chan = %04x)\n", channel);
2073 } 2073 }
2074 2074
2075 aim_info_free(&userinfo); 2075 aim_info_free(&userinfo);
2076 2076
2077 return ret; 2077 return ret;