Skip to content

Commit

Permalink
crypto: user - fix empty string test in report API
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Steffen Klassert <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
minipli authored and herbertx committed Feb 19, 2013
1 parent 9a5467b commit e336ed9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/crypto_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e336ed9

Please sign in to comment.