lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 02 Nov 2020 11:48:25 +0100
From:   Paolo Abeni <pabeni@...hat.com>
To:     Davide Caratti <dcaratti@...hat.com>, mptcp@...ts.01.org,
        netdev@...r.kernel.org
Cc:     Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net] mptcp: token: fix unititialized variable

On Mon, 2020-11-02 at 10:09 +0100, Davide Caratti wrote:
> gcc complains about use of uninitialized 'num'. Fix it by doing the first
> assignment of 'num' when the variable is declared.
> 
> Fixes: 96d890daad05 ("mptcp: add msk interations helper")
> Signed-off-by: Davide Caratti <dcaratti@...hat.com>
> ---
>  net/mptcp/token.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mptcp/token.c b/net/mptcp/token.c
> index 8b47c4bb1c6b..feb4b9ffd462 100644
> --- a/net/mptcp/token.c
> +++ b/net/mptcp/token.c
> @@ -291,7 +291,7 @@ struct mptcp_sock *mptcp_token_iter_next(const struct net *net, long *s_slot,
>  {
>  	struct mptcp_sock *ret = NULL;
>  	struct hlist_nulls_node *pos;
> -	int slot, num;
> +	int slot, num = 0;
>  
>  	for (slot = *s_slot; slot <= token_mask; *s_num = 0, slot++) {
>  		struct token_bucket *bucket = &token_hash[slot];

LGTM, thanks Davide!

Acked-by: Paolo Abeni <pabeni@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ