public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/4] staging: sm750fb: replace strcat() with memcpy() in lynxfb_setup()
@ 2026-02-03 23:07 Artem Lytkin
  2026-02-03 23:07 ` [PATCH 2/4] staging: sm750fb: use strcmp() for exact option matching Artem Lytkin
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Artem Lytkin @ 2026-02-03 23:07 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin

Replace deprecated strcat() with memcpy() in option parsing. The
destination buffer is allocated with kzalloc (zero-filled) and the
write position is tracked via pointer, making the null-terminator
scan in strcat() redundant and potentially unsafe.

Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index fecd7457e..4c6e84c03 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1163,7 +1163,7 @@ static int __init lynxfb_setup(char *options)
 		} else if (!strncmp(opt, "dual", strlen("dual"))) {
 			g_dualview = 1;
 		} else {
-			strcat(tmp, opt);
+			memcpy(tmp, opt, strlen(opt));
 			tmp += strlen(opt);
 			if (options)
 				*tmp++ = ':';
-- 
2.43.0


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

end of thread, other threads:[~2026-02-04  9:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 23:07 [PATCH 1/4] staging: sm750fb: replace strcat() with memcpy() in lynxfb_setup() Artem Lytkin
2026-02-03 23:07 ` [PATCH 2/4] staging: sm750fb: use strcmp() for exact option matching Artem Lytkin
2026-02-03 23:07 ` [PATCH 3/4] staging: sm750fb: convert pr_* to dev_* logging in sm750.c Artem Lytkin
2026-02-04  9:54   ` Dan Carpenter
2026-02-03 23:07 ` [PATCH 4/4] staging: sm750fb: convert pr_* to dev_* logging in sm750_hw.c Artem Lytkin
2026-02-04  9:55   ` Dan Carpenter
2026-02-04  9:51 ` [PATCH 1/4] staging: sm750fb: replace strcat() with memcpy() in lynxfb_setup() Dan Carpenter

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