[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15af4bc4-2066-44bc-8d2e-839ff3945663@lunn.ch>
Date: Fri, 13 Oct 2023 14:22:52 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Justin Stitt <justinstitt@...gle.com>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] net: phy: tja11xx: replace deprecated strncpy with
ethtool_sprintf
> - for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++) {
> - strncpy(data + i * ETH_GSTRING_LEN,
> - tja11xx_hw_stats[i].string, ETH_GSTRING_LEN);
> - }
> + for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++)
> + ethtool_sprintf(&data, "%s", tja11xx_hw_stats[i].string);
> }
I assume you are using "%s" because tja11xx_hw_stats[i].string cannot
be trusted as a format string? Is this indicating we need an
ethtool_puts() ?
Andrew
Powered by blists - more mailing lists