decrypt_key.c: Upon error, after freeing contents field, set to
authorEzra Peisach <epeisach@mit.edu>
Fri, 8 Sep 1995 23:55:28 +0000 (23:55 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 8 Sep 1995 23:55:28 +0000 (23:55 +0000)
null to indicate to upper levels that it is really empty.

Another bug discovered by purify...

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6743 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/ChangeLog
src/lib/kdb/decrypt_key.c

index 88d23c947f9fc16fa3207f63cba54fe183657807..18218a3968fa74026c12bb166beb048b31c376eb 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep  8 19:52:34 1995  Ezra Peisach  (epeisach@dcl)
+
+       * decrypt_key.c: Upon error, after freeing contents field, set to
+               null to indicate to upper levels that it is really empty.
+
 Wed Sep 06 14:20:57 1995   Chris Provenzano (proven@mit.edu)
 
         * decrypt_key.c, encrypt_key.c, fetch_mkey.c, kdb_compat.c,
index a1762fbeca6b16274c0a0920e6b624a57b265a68..f6847eb8354208a7123049c1232dbdd629763fc6 100644 (file)
@@ -62,6 +62,8 @@ krb5_dbekd_decrypt_key_data(context, eblock, key_data, keyblock, keysalt)
                               key_data->key_data_length[0] - 2, 
                               eblock, 0))) {
        krb5_xfree(keyblock->contents);
+       keyblock->contents = 0;
+       keyblock->length = 0;
        return retval;
     }
 
@@ -72,6 +74,8 @@ krb5_dbekd_decrypt_key_data(context, eblock, key_data, keyblock, keysalt)
            if (keysalt->data.length = key_data->key_data_length[1]) {
                if (!(keysalt->data.data=(char *)malloc(keysalt->data.length))){
                    krb5_xfree(keyblock->contents);
+                   keyblock->contents = 0;
+                   keyblock->length = 0;
                    return ENOMEM;
                }
                memcpy(keysalt->data.data, key_data->key_data_contents[1],