summaryrefslogtreecommitdiffstats
path: root/security/keys
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2011-01-17 01:25:34 +0100
committerJames Morris <jmorris@namei.org>2011-01-18 23:53:56 +0100
commit0e7491f685cbc962f2ef977f7b5f8ed0b3100e88 (patch)
tree44d27bf6f64b974eb8d177316c3fd77f66324b13 /security/keys
parenttrusted-keys: another free memory bugfix (diff)
downloadlinux-0e7491f685cbc962f2ef977f7b5f8ed0b3100e88.tar.xz
linux-0e7491f685cbc962f2ef977f7b5f8ed0b3100e88.zip
trusted-keys: check for NULL before using it
TSS_rawhmac() checks for data != NULL before using it. We should do the same thing for TSS_authhmac(). Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reviewed-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Mimi Zohar <zohar@us.ibm.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/keys')
-rw-r--r--security/keys/trusted_defined.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/security/keys/trusted_defined.c b/security/keys/trusted_defined.c
index 7b2179589063..f7d06776faf0 100644
--- a/security/keys/trusted_defined.c
+++ b/security/keys/trusted_defined.c
@@ -148,6 +148,11 @@ static int TSS_authhmac(unsigned char *digest, const unsigned char *key,
if (dlen == 0)
break;
data = va_arg(argp, unsigned char *);
+ if (!data) {
+ ret = -EINVAL;
+ va_end(argp);
+ goto out;
+ }
ret = crypto_shash_update(&sdesc->shash, data, dlen);
if (ret < 0) {
va_end(argp);