Skip to contentSkip to conversation

crypto: algif_aead - fix uninitialized variable warning

PATCH In review Stephan Müller 2 participants 2 messages Dec 8, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: algif_aead - fix uninitialized variable warning

In case the user provided insufficient data, the code may return prematurely without any operation. In this case, the processed data indicated with outlen is zero.

---
 crypto/algif_aead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/algif_aead.c +1 -1
index 2fbf239..e9c0993 100644
@@ -420,7 +420,7 @@ static int aead_recvmsg_async(struct socket *sock, struct msghdr *msg,
 	unsigned int i, reqlen = GET_REQ_SIZE(tfm);
 	int err = -ENOMEM;
 	unsigned long used;
-	size_t outlen;
+	size_t outlen = 0;
 	size_t usedpages = 0;
 
 	lock_sock(sk);
Signature · 1 line
2.9.3
maintainer
#1 lore raw
Quoted 6 lines · Stephan Müller

In case the user provided insufficient data, the code may return prematurely without any operation. In this case, the processed data indicated with outlen is zero.

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt