crypto: algif_aead - fix uninitialized variable warning
authorStephan Mueller <smueller@chronox.de>
Thu, 8 Dec 2016 06:09:44 +0000 (07:09 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 8 Dec 2016 12:09:22 +0000 (20:09 +0800)
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.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_aead.c

index 2fbf239bb1f2a7b22a6d9cc15b89a903d4184c8f..e9c0993b131dc34d435d29358a037f56ca62e2b8 100644 (file)
@@ -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);