Skip to content

Commit

Permalink
trusted-keys: check for NULL before using it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tetsuo Handa authored and James Morris committed Jan 18, 2011
1 parent 35576ea commit 0e7491f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions security/keys/trusted_defined.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0e7491f

Please sign in to comment.