[PATCH 15/35] fbdev: gbefb: Use safer strscpy() instead of strcpy()

From
Ai Chao <hidden>
Date
2026-04-25 07:00:22
Also in
dri-devel, linux-arm-kernel, lkml
Reply to
Ai Chao, 2026-04-25
Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <redacted>
---
 drivers/video/fbdev/gbefb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c
index cb6ff15a21db..34da219b6e76 100644
--- a/drivers/video/fbdev/gbefb.c
+++ b/drivers/video/fbdev/gbefb.c
@@ -818,7 +818,7 @@ static void gbefb_encode_fix(struct fb_fix_screeninfo *fix,
 			     struct fb_var_screeninfo *var)
 {
 	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
-	strcpy(fix->id, "SGI GBE");
+	strscpy(fix->id, "SGI GBE");
 	fix->smem_start = (unsigned long) gbe_mem;
 	fix->smem_len = gbe_mem_size;
 	fix->type = FB_TYPE_PACKED_PIXELS;
-- 
2.34.1
Thread (22 messages) 22 messages, 3 authors, last reply 2026-04-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help