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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210824174123.h6iispbooeqrychw@lion.mk-sys.cz>
Date:   Tue, 24 Aug 2021 19:41:23 +0200
From:   Michal Kubecek <mkubecek@...e.cz>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     andrew@...n.ch, netdev@...r.kernel.org, dcavalca@...com,
        filbranden@...com, michel@...com
Subject: Re: [PATCH ethtool 2/3] ethtool: use dummy args[] entry for no-args
 case

On Fri, Aug 13, 2021 at 10:19:37AM -0700, Jakub Kicinski wrote:
> Note that this patch adds a false-positive warning with GCC 11:
> 
> ethtool.c: In function ‘find_option’:
> ethtool.c:6082:29: warning: offset ‘1’ outside bounds of constant string [-Warray-bounds]
>  6082 |                         opt += len + 1;
>       |                         ~~~~^~~~~~~~~~
> 
> we'll never get to that code if the string is empty.

Unless I missed something, an easy workaround should be starting the
loop in find_option() from 1 rather than from 0. It would IMHO even make
more sense as there is little point comparing the first argument against
the dummy args[0] entry.

Michal

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ