From 0e7491f685cbc962f2ef977f7b5f8ed0b3100e88 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Mon, 17 Jan 2011 09:25:34 +0900 Subject: [PATCH] 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 Reviewed-by: Jesper Juhl Acked-by: Mimi Zohar Acked-by: David Howells Signed-off-by: James Morris --- security/keys/trusted_defined.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.34.1