diff options
author | Mathias Krause <minipli@googlemail.com> | 2013-02-05 18:19:14 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-02-19 20:27:04 +0800 |
commit | e336ed9647b06e3bb52995dbc51101cbdf39f2a2 (patch) | |
tree | 08ad18361dc19e23ad2941dbb595793107245eaa /crypto/crypto_user.c | |
parent | 9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6 (diff) | |
download | lwn-e336ed9647b06e3bb52995dbc51101cbdf39f2a2.tar.gz lwn-e336ed9647b06e3bb52995dbc51101cbdf39f2a2.zip |
crypto: user - fix empty string test in report API
The current test for empty strings fails because it is testing the
address of a field, not a pointer. So the test will always be true.
Test the first character in the string to not be null instead.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/crypto_user.c')
-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 f6d9baf77f0a..423a267022f4 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c @@ -196,7 +196,7 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, struct crypto_dump_info info; int err; - if (!p->cru_driver_name) + if (!p->cru_driver_name[0]) return -EINVAL; alg = crypto_alg_match(p, 1); |