[PATCH 1/4] staging: sm750fb: replace strcat() with memcpy() in lynxfb_setup()
From: Artem Lytkin
Date: Tue Feb 03 2026 - 18:08:10 EST
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@xxxxxxxxx>
---
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