Messages in this thread | | | Date | Wed, 11 Oct 2023 01:06:43 +0300 | From | Vladimir Oltean <> | Subject | Re: [PATCH] net: dsa: realtek: rtl8365mb: replace deprecated strncpy with ethtool_sprintf |
| |
On Tue, Oct 10, 2023 at 02:48:07PM -0700, Justin Stitt wrote: > On Tue, Oct 10, 2023 at 10:36 AM Justin Stitt <justinstitt@google.com> wrote: > > > Is there any particular reason why you opted for the "%s" printf format > > > specifier when you could have simply given mib->name as the single > > > argument? This comment applies to all the ethtool_sprintf() patches > > > you've submitted. > > > > Yeah, it causes a -Wformat-security warning for me. I briefly mentioned it > > in one of my first patches like this [1]. > > For more context, here's some warnings in the wild: > https://lore.kernel.org/netdev/20231003183603.3887546-3-jesse.brandeburg@intel.com/ > > > > > [1]: https://lore.kernel.org/all/20231005-strncpy-drivers-net-dsa-lan9303-core-c-v2-1-feb452a532db@google.com/
Yeah, ok. It's a false positive warning, but I guess it would be too hard for the compiler to figure that out.
| |