From: Tetsuo Handa Date: Mon, 17 Jan 2011 00:25:34 +0000 (+0900) Subject: trusted-keys: check for NULL before using it X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e7491f685cbc962f2ef977f7b5f8ed0b3100e88;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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);