mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: "Miguel García" <miguelgarciaroman8@gmail.com>,
	linux-wireless@vger.kernel.org
Cc: <linux-kernel@vger.kernel.org>, <ajay.kathat@microchip.com>,
	<claudiu.beznea@tuxon.dev>, <marex@denx.de>, <kvalo@kernel.org>,
	<skhan@linuxfoundation.org>
Subject: Re: [PATCH] wilc1000: replace deprecated strcpy() with strscpy()
Date: Mon, 07 Jul 2025 08:58:53 +0200	[thread overview]
Message-ID: <DB5MMOAEFZZU.5TK1BDNOTFEO@bootlin.com> (raw)
In-Reply-To: <20250705134810.197494-1-miguelgarciaroman8@gmail.com>

Hi,

On Sat Jul 5, 2025 at 3:48 PM CEST, Miguel García wrote:
> strcpy() is deprecated for NUL-terminated strings.  Replace the single
> instance in wilc1000 netdev setup with strscpy(), which guarantees
> NUL-termination and prevents overflow.
>
> ndev->name is a fixed-size buffer (IFNAMSIZ, 16 bytes).
>
> Signed-off-by: Miguel García <miguelgarciaroman8@gmail.com>

LGTM, thanks for the update

Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>

> ---
>  drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c
> index af298021e050..8f4d11e1a2a6 100644
> --- a/drivers/net/wireless/microchip/wilc1000/netdev.c
> +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
> @@ -960,7 +960,7 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
>  
>  	vif = netdev_priv(ndev);
>  	ndev->ieee80211_ptr = &vif->priv.wdev;
> -	strcpy(ndev->name, name);
> +	strscpy(ndev->name, name, sizeof(ndev->name));
>  	vif->wilc = wl;
>  	vif->ndev = ndev;
>  	ndev->ml_priv = vif;




-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2025-07-07  6:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-05 13:48 Miguel García
2025-07-07  6:58 ` Alexis Lothoré [this message]
2025-08-13 14:13   ` Miguel García Román

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB5MMOAEFZZU.5TK1BDNOTFEO@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=ajay.kathat@microchip.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=miguelgarciaroman8@gmail.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®