diff options
author | Bitterblue Smith <rtl8821cerfe2@gmail.com> | 2022-11-10 15:59:29 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-11-16 11:30:43 +0200 |
commit | 9b00565abf3f961b10b2fdf8f762e10ef4cf3acd (patch) | |
tree | 0a9f5260e5af1dbb908ba55b76f17b5203842a6b /drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | |
parent | 486e0315c4a1f4e8ea8da0e7de92d89ee8e1ba0a (diff) |
wifi: rtl8xxxu: Use strscpy instead of sprintf
Fill priv->chip_name and priv->chip_vendor with strscpy instead of
sprintf. This is just to prevent future bugs in case the name of a
chip/vendor becomes longer than the size of chip_name/chip_vendor.
Suggested-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/5fc9cc0e-eecb-8428-aeb1-f745791c0f16@gmail.com
Diffstat (limited to 'drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c')
-rw-r--r-- | drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c index 558572bdd2c8..ece82e613bf0 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c @@ -319,7 +319,7 @@ static int rtl8723bu_identify_chip(struct rtl8xxxu_priv *priv) goto out; } - sprintf(priv->chip_name, "8723BU"); + strscpy(priv->chip_name, "8723BU", sizeof(priv->chip_name)); priv->rtl_chip = RTL8723B; priv->rf_paths = 1; priv->rx_paths = 1; |