From 93d07180c1a5ab0453e9ec12a5f0c41b894fd16d Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 14 Dec 2001 18:45:28 +0000 Subject: [PATCH] * hmac_md5.c (k5_hmac_md5_hash): Test if malloc returns NULL and not the argument to malloc. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14071 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/keyhash_provider/ChangeLog | 5 +++++ src/lib/crypto/keyhash_provider/hmac_md5.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/crypto/keyhash_provider/ChangeLog b/src/lib/crypto/keyhash_provider/ChangeLog index 2ded8692e..84bb79577 100644 --- a/src/lib/crypto/keyhash_provider/ChangeLog +++ b/src/lib/crypto/keyhash_provider/ChangeLog @@ -1,3 +1,8 @@ +2001-12-14 Ezra Peisach + + * hmac_md5.c (k5_hmac_md5_hash): Test if malloc returns NULL and + not the argument to malloc. + 2001-12-05 Ezra Peisach * t_cksum.c (main): Free memory leak in tests. diff --git a/src/lib/crypto/keyhash_provider/hmac_md5.c b/src/lib/crypto/keyhash_provider/hmac_md5.c index 2f406c5d4..08808ff91 100644 --- a/src/lib/crypto/keyhash_provider/hmac_md5.c +++ b/src/lib/crypto/keyhash_provider/hmac_md5.c @@ -58,7 +58,7 @@ k5_hmac_md5_hash (const krb5_keyblock *key, krb5_keyusage usage, ds.length = key->length; ks.length = key->length; ds.data = malloc(ds.length); - if (ds.length == NULL) + if (ds.data == NULL) return ENOMEM; ks.contents = (void *) ds.data; -- 2.26.2