350-v5.4-brcmfmac-use-strlcpy-instead-of-strcpy.patch 1.1 KB

1234567891011121314151617181920212223242526
  1. From bbfab331e3abd9fa8767eea6bf5c4684cdd4b934 Mon Sep 17 00:00:00 2001
  2. From: Neo Jou <neojou@gmail.com>
  3. Date: Tue, 21 May 2019 17:12:20 +0800
  4. Subject: [PATCH] brcmfmac: use strlcpy() instead of strcpy()
  5. The function strcpy() is inherently not safe. Though the function
  6. works without problems here, it would be better to use other safer
  7. function, e.g. strlcpy(), to replace strcpy() still.
  8. Signed-off-by: Neo Jou <neojou@gmail.com>
  9. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  10. ---
  11. drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +-
  12. 1 file changed, 1 insertion(+), 1 deletion(-)
  13. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  14. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  15. @@ -157,7 +157,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
  16. /* query for 'ver' to get version info from firmware */
  17. memset(buf, 0, sizeof(buf));
  18. - strcpy(buf, "ver");
  19. + strlcpy(buf, "ver", sizeof(buf));
  20. err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
  21. if (err < 0) {
  22. bphy_err(drvr, "Retrieving version information failed, %d\n",