public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8192e: Replace strcpy with strscpy in rtl819x_translate_scan
@ 2024-08-20 18:42 Abhishek Tamboli
  2024-08-20 19:29 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Abhishek Tamboli @ 2024-08-20 18:42 UTC (permalink / raw)
  To: gregkh
  Cc: tdavies, philipp.g.hortmann, garyrookard, linux-staging, skhan,
	rbmarliere, linux-kernel-mentees, linux-kernel

Replace strcpy() with strscpy() in rtl819x_translate_scan() 
function to ensure buffer safety.

Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com>
---
 drivers/staging/rtl8192e/rtllib_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index fbd4ec824084..970b7fcb3f7e 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -61,7 +61,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
 	iwe.cmd = SIOCGIWNAME;
 	for (i = 0; i < ARRAY_SIZE(rtllib_modes); i++) {
 		if (network->mode & BIT(i)) {
-			strcpy(pname, rtllib_modes[i]);
+			strscpy(pname, rtllib_modes[i], sizeof(pname));
 			pname += strlen(rtllib_modes[i]);
 		}
 	}
--
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-24 11:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 18:42 [PATCH] staging: rtl8192e: Replace strcpy with strscpy in rtl819x_translate_scan Abhishek Tamboli
2024-08-20 19:29 ` Dan Carpenter
2024-08-21 17:48   ` Abhishek Tamboli
2024-08-21 18:22     ` Dan Carpenter
2024-08-20 19:38 ` Christophe JAILLET
2024-08-21 18:23   ` Dan Carpenter
2024-08-24  6:35     ` Christophe JAILLET
2024-08-24 11:18       ` Dan Carpenter
2024-08-21  9:43 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox