Skip to content

Commit

Permalink
brcmfmac: use strlcpy() instead of strcpy()
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
neojou authored and Kalle Valo committed May 28, 2019
1 parent b07e1ae commit bbfab33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,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",
Expand Down

0 comments on commit bbfab33

Please sign in to comment.