From: David Laight Date: Mon, 8 Jun 2026 09:54:55 +0000 (+0100) Subject: fbdev: s3fb: Use strscpy() to copy strings into arrays X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60786bff19772504706d1a4034d911dc5a1f2010;p=thirdparty%2Fkernel%2Flinux.git fbdev: s3fb: Use strscpy() to copy strings into arrays Replacing strcpy() with strscpy() ensures that overflow of the target buffer cannot happen. Signed-off-by: David Laight Signed-off-by: Helge Deller --- diff --git a/drivers/video/fbdev/s3fb.c b/drivers/video/fbdev/s3fb.c index dc1f9b627185d..cecbac99c8e0d 100644 --- a/drivers/video/fbdev/s3fb.c +++ b/drivers/video/fbdev/s3fb.c @@ -1333,7 +1333,7 @@ static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) vga_wcrt(par->state.vgabase, 0x38, cr38); vga_wcrt(par->state.vgabase, 0x39, cr39); - strcpy(info->fix.id, s3_names [par->chip]); + strscpy(info->fix.id, s3_names[par->chip]); info->fix.mmio_start = 0; info->fix.mmio_len = 0; info->fix.type = FB_TYPE_PACKED_PIXELS;