From: Jon Trulson Date: Fri, 26 Dec 2014 21:12:10 +0000 (-0700) Subject: ttauth: Coverity (memory corruption) X-Git-Tag: 2.2.3~92 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f719d20b6c850e8db4bd1f17969a04b3d80e4a2a;p=oweals%2Fcde.git ttauth: Coverity (memory corruption) --- diff --git a/cde/lib/tt/bin/ttauth/process.c b/cde/lib/tt/bin/ttauth/process.c index bbaddd4f..bafd259c 100644 --- a/cde/lib/tt/bin/ttauth/process.c +++ b/cde/lib/tt/bin/ttauth/process.c @@ -1252,7 +1252,7 @@ static int do_add (inputfilename, lineno, argc, argv) char *netid; char *authname; char *authdata_hex; - char *authdata; + char *authdata = NULL; int protodata_len, authdata_len; _tt_AuthFileEntry *entry; _tt_AuthFileEntryList *list; @@ -1345,6 +1345,9 @@ static int do_add (inputfilename, lineno, argc, argv) entry->auth_data_length = authdata_len; entry->auth_data = authdata; + /* Avoid a double free later on in the event of an error */ + authdata = NULL; + if (!entry->protocol_name || (!entry->protocol_data && entry->protocol_data_length > 0) || !entry->network_id || !entry->auth_name ||