changeset 13653:ad83024934ed

[gaim-migrate @ 16055] Fix Coverity CID 86: Malformed incoming IMs could cause a double-free. I don't think this will ever happen because the oscar servers filter malformed SNACs. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 18 Apr 2006 04:25:54 +0000
parents a07dcc2c01bd
children b6f7686c6082
files src/protocols/oscar/family_icbm.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/family_icbm.c	Tue Apr 18 04:03:18 2006 +0000
+++ b/src/protocols/oscar/family_icbm.c	Tue Apr 18 04:25:54 2006 +0000
@@ -1679,13 +1679,13 @@
 
 		} else if (type == 0x0017) {
 
-			free(args.extdata);
-			args.extdatalen = length;
-			if (args.extdatalen > byte_stream_empty(bs))
+			if (length > byte_stream_empty(bs))
 			{
 				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);
 				break;
 			}
+			free(args.extdata);
+			args.extdatalen = length;
 			if (args.extdatalen == 0)
 				args.extdata = NULL;
 			else