brcmfmac: use strlcpy() instead of strcpy()
PATCH 1/1 brcmfmac: use strlcpy() instead of strcpy()
From: Neo Jou <[email protected]>
The function strcpy() is inherently not safe. Though the function works without problems here, it would be better to use other safer function, e.g. strlcpy(), to replace strcpy() still.
Signed-off-by Neo Jou <[email protected]>
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +1 -1
@@ -269,7 +269,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)/* query for 'ver' to get version info from firmware */ memset (buf,0 ,sizeof (buf)); -strcpy (buf,"ver" ); +strlcpy (buf,"ver" ,sizeof (buf)); err =brcmf_fil_iovar_data_get (ifp,"ver" , buf,sizeof (buf));if (err <0 ) { bphy_err(drvr, "Retrieving version information failed, %d\n",
Signature · 1 line
2.7.4
Quoted 7 lines · [email protected] wrote:
From: Neo Jou <[email protected]>
The function
strcpy()is inherently not safe. Though the function works without problems here, it would be better to use other safer function, e.g.strlcpy(), to replacestrcpy()still.Signed-off-by Neo Jou <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
bbfab331e3ab brcmfmac: use strlcpy() instead of strcpy()
Signature · 3 lines
https://patchwork.kernel.org/patch/10953203/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches