提交 c33fdc34 编写于 作者: C Colin Ian King 提交者: David S. Miller

tipc: fix update of the uninitialized variable err

Variable err is not uninitialized and hence can potentially contain
any garbage value.  This may cause an error when logical or'ing the
return values from the calls to functions crypto_aead_setauthsize or
crypto_aead_setkey.  Fix this by setting err to the return of
crypto_aead_setauthsize rather than or'ing in the return into the
uninitialized variable

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: fc1b6d6d ("tipc: introduce TIPC encryption & authentication")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 59618bc0
......@@ -463,7 +463,7 @@ static int tipc_aead_init(struct tipc_aead **aead, struct tipc_aead_key *ukey,
break;
}
err |= crypto_aead_setauthsize(tfm, TIPC_AES_GCM_TAG_SIZE);
err = crypto_aead_setauthsize(tfm, TIPC_AES_GCM_TAG_SIZE);
err |= crypto_aead_setkey(tfm, ukey->key, keylen);
if (unlikely(err)) {
crypto_free_aead(tfm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册