From 9c3f755c94a586496b647bbe72276feeb93722f6 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 8 Sep 1995 23:55:28 +0000 Subject: [PATCH] decrypt_key.c: Upon error, after freeing contents field, set to 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 | 5 +++++ src/lib/kdb/decrypt_key.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 88d23c947..18218a396 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -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, diff --git a/src/lib/kdb/decrypt_key.c b/src/lib/kdb/decrypt_key.c index a1762fbec..f6847eb83 100644 --- a/src/lib/kdb/decrypt_key.c +++ b/src/lib/kdb/decrypt_key.c @@ -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], -- 2.26.2