diff options
author | Jesper Juhl <jj@chaosbits.net> | 2012-01-29 17:39:22 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-02-04 23:12:25 -0500 |
commit | 0cfdec7a65c98de6637e547a04a33969dc9c61b1 (patch) | |
tree | 052e9b64882142a535e009f647235dadb0d9f1de /crypto | |
parent | 65a4a573b74f8f27e33a99c21a5a5d2fc4d82a1a (diff) |
crypto: In crypto_add_alg(), 'exact' wants to be initialized to 0
We declare 'exact' without initializing it and then do:
[...]
if (strlen(p->cru_driver_name))
exact = 1;
if (priority && !exact)
return -EINVAL;
[...]
If the first 'if' is not true, then the second will test an
uninitialized 'exact'.
As far as I can tell, what we want is for 'exact' to be initialized to
0 (zero/false).
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/crypto_user.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 3ba6ef508869..3e61cc101e83 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c | |||
@@ -304,7 +304,7 @@ static int crypto_del_alg(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
304 | static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh, | 304 | static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh, |
305 | struct nlattr **attrs) | 305 | struct nlattr **attrs) |
306 | { | 306 | { |
307 | int exact; | 307 | int exact = 0; |
308 | const char *name; | 308 | const char *name; |
309 | struct crypto_alg *alg; | 309 | struct crypto_alg *alg; |
310 | struct crypto_user_alg *p = nlmsg_data(nlh); | 310 | struct crypto_user_alg *p = nlmsg_data(nlh); |