Commit 0e7491f685cbc962f2ef977f7b5f8ed0b3100e88

Authored by Tetsuo Handa
Committed by James Morris
1 parent 35576eab39

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>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

security/keys/trusted_defined.c
... ... @@ -148,6 +148,11 @@
148 148 if (dlen == 0)
149 149 break;
150 150 data = va_arg(argp, unsigned char *);
  151 + if (!data) {
  152 + ret = -EINVAL;
  153 + va_end(argp);
  154 + goto out;
  155 + }
151 156 ret = crypto_shash_update(&sdesc->shash, data, dlen);
152 157 if (ret < 0) {
153 158 va_end(argp);