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]
Message-ID: <CA+6hz4ryFfMGK9q_AvR2LSdmSoG4ZjhmaZ5Mf0qBi9-0jGVkNw@mail.gmail.com>
Date:   Tue, 18 Oct 2016 08:59:58 +0800
From:   Feng Gao <gfree.wind@...il.com>
To:     Patrick McHardy <kaber@...sh.net>,
        "David S. Miller" <davem@...emloft.net>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>
Cc:     Feng Gao <gfree.wind@...il.com>, Gao Feng <fgao@...ai8.com>
Subject: Re: [PATCH 1/1] net: vlan: Use sizeof instead of literal number

On Tue, Oct 18, 2016 at 8:44 AM,  <fgao@...ai8.com> wrote:
> From: Gao Feng <fgao@...ai8.com>
>
> Use sizeof variable instead of literal number to enhance the readability.
>
> Signed-off-by: Gao Feng <fgao@...ai8.com>
> ---
>  net/8021q/vlan.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
> index 8de138d..5a3903b 100644
> --- a/net/8021q/vlan.c
> +++ b/net/8021q/vlan.c
> @@ -515,8 +515,8 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
>                 return -EFAULT;
>
>         /* Null terminate this sucker, just in case. */
> -       args.device1[23] = 0;
> -       args.u.device2[23] = 0;
> +       args.device1[sizeof(args.device1) - 1] = 0;
> +       args.u.device2[sizeof(args.u.device2) - 1] = 0;
>
>         rtnl_lock();
>
> --
> 1.9.1
>
>

Sorry, I forget add the "net-next" in the title.
Now I have sent another new patch, please ignore this conversation.

Regards
Feng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ