diff src/protocols/oscar/oscar.c @ 13662:b198d0c26b83

[gaim-migrate @ 16064] Fix Coverity CID 26: A potential crash when the server sends us an incoming channel 2 ICBM of the ICQ server relay type but does not send the data normally associated with such an ICBM. This should never happen. Fix Coverity CID 45: A potential crash when the server sends us an incoming channel 2 ICBM but does not send the data normally associated with such an ICBM. This should never happen. Fix Coverity CID 47: A 1 byte memleak when signing on using the old blist method and not when using SSI. This never happens. As far as I can tell it has been like this since the beginning of time. It's a weird memleak. Fix Coverity CID 57: A memleak of the length of a screen name when searching for screen names by email address and the server returns a malformed SNAC. This should never happen. Fix Coverity CID 59: A memleak of the length of an ICBM when _parsing_ an outgoing ICBM. I don't believe this ever happens, and I suspect the code exists from a time when libfaim was perhaps being written so that it could be used in an AIM server (in addition to just a client). I should probably remove the function. Fix Coverity CID 132: A memleak of the length of the email address when searching for screen names by email address. Fix Coverity CID 146: Check the return value of read() and print a warning to the debug window. This code is only used when AOL enables their crazy AIM executable hash value stuff, which hasn't happened in 5 years or so. Fix Coverity CID 191: Comment out some code that isn't used. Fix Coverity CID 192: Get rid of a harmless assignment to a variable that wasn't used. Fix Coverity CID 194: Comment out some variables and code that isn't used. Fix Coverity CID 198: Get rid of a variable that wasn't used in gaim_ssi_parselist(). committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 19 Apr 2006 03:31:47 +0000
parents b6f7686c6082
children 4132d997ccec
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Wed Apr 19 02:41:27 2006 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Apr 19 03:31:47 2006 +0000
@@ -1179,7 +1179,6 @@
 	oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ERROR, gaim_ssi_parseerr, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RIGHTSINFO, gaim_ssi_parserights, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_LIST, gaim_ssi_parselist, 0);
-	oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_NOLIST, gaim_ssi_parselist, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_SRVACK, gaim_ssi_parseack, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ADD, gaim_ssi_parseadd, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTH, gaim_ssi_authgiven, 0);
@@ -1454,7 +1453,11 @@
 		g_free(pos);
 		return;
 	}
-	read(pos->fd, m, 16);
+	if (read(pos->fd, m, 16) != 16)
+	{
+		gaim_debug_warning("oscar", "Could not read full AIM login hash "
+				"from " AIMHASHDATA "--that's bad.\n");
+	}
 	m[16] = '\0';
 	gaim_debug_misc("oscar", "Sending hash: ");
 	for (x = 0; x < 16; x++)
@@ -3351,6 +3354,7 @@
 }
 
 static int gaim_parse_evilnotify(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) {
+#ifdef CRAZY_WARNING
 	va_list ap;
 	guint16 newevil;
 	aim_userinfo_t *userinfo;
@@ -3360,7 +3364,6 @@
 	userinfo = va_arg(ap, aim_userinfo_t *);
 	va_end(ap);
 
-#ifdef CRAZY_WARNING
 	gaim_prpl_got_account_warning_level(account, (userinfo && userinfo->sn) ? userinfo->sn : NULL, (newevil/10.0) + 0.5);
 #endif
 
@@ -4633,7 +4636,6 @@
 	guint32 tmp;
 	va_list ap;
 	guint16 fmtver, numitems;
-	struct aim_ssi_item *items;
 	guint32 timestamp;
 
 	gc = od->gc;
@@ -4643,7 +4645,6 @@
 	va_start(ap, fr);
 	fmtver = (guint16)va_arg(ap, int);
 	numitems = (guint16)va_arg(ap, int);
-	items = va_arg(ap, struct aim_ssi_item *);
 	timestamp = va_arg(ap, guint32);
 	va_end(ap);