lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2023-10-11 00:08    [W:0.036 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site