Explorar o código

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>
Mathias Krause %!s(int64=13) %!d(string=hai) anos
pai
achega
e336ed9647
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      crypto/crypto_user.c

+ 1 - 1
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);