projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35576ea
)
trusted-keys: check for NULL before using it
author
Tetsuo Handa
<
[email protected]
>
Mon, 17 Jan 2011 00:25:34 +0000
(09:25 +0900)
committer
James Morris
<
[email protected]
>
Tue, 18 Jan 2011 22:53:56 +0000
(09:53 +1100)
TSS_rawhmac() checks for data != NULL before using it.
We should do the same thing for TSS_authhmac().
Signed-off-by: Tetsuo Handa <
[email protected]
>
Reviewed-by: Jesper Juhl <
[email protected]
>
Acked-by: Mimi Zohar <
[email protected]
>
Acked-by: David Howells <
[email protected]
>
Signed-off-by: James Morris <
[email protected]
>
security/keys/trusted_defined.c
patch
|
blob
|
history
diff --git
a/security/keys/trusted_defined.c
b/security/keys/trusted_defined.c
index 7b217958906388ea239f85ef5a1fd33a153a5203..f7d06776faf0f533576aa5fca4935dcd14d1fa6a 100644
(file)
--- 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);