]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fbdev: s3fb: Use strscpy() to copy strings into arrays
authorDavid Laight <david.laight.linux@gmail.com>
Mon, 8 Jun 2026 09:54:55 +0000 (10:54 +0100)
committerHelge Deller <deller@gmx.de>
Tue, 9 Jun 2026 14:06:07 +0000 (16:06 +0200)
Replacing strcpy() with strscpy() ensures that overflow of the target
buffer cannot happen.

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/s3fb.c

index dc1f9b627185d311fb7c387665e324dd4e38bdbd..cecbac99c8e0dcee8d7dc0a2d481d8f7fa2dc41f 100644 (file)
@@ -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;