Skip to content

Commit e336ed9

Browse files
minipliherbertx
authored andcommitted
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 <[email protected]> Cc: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 9a5467b commit e336ed9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/crypto_user.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh,
196196
struct crypto_dump_info info;
197197
int err;
198198

199-
if (!p->cru_driver_name)
199+
if (!p->cru_driver_name[0])
200200
return -EINVAL;
201201

202202
alg = crypto_alg_match(p, 1);

0 commit comments

Comments
 (0)