Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

m68k: emu: Replace unbounded sprintf() in nfhd_init_one()

Replace unbounded sprintf() with the safer snprintf().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://patch.msgid.link/20260318001632.2974-3-thorsten.blum@linux.dev
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Thorsten Blum and committed by
Geert Uytterhoeven
59747bec 5247c783

+2 -1
+2 -1
arch/m68k/emu/nfblock.c
··· 132 132 dev->disk->minors = 16; 133 133 dev->disk->fops = &nfhd_ops; 134 134 dev->disk->private_data = dev; 135 - sprintf(dev->disk->disk_name, "nfhd%u", dev_id); 135 + snprintf(dev->disk->disk_name, sizeof(dev->disk->disk_name), "nfhd%u", 136 + dev_id); 136 137 set_capacity(dev->disk, (sector_t)blocks * (bsize / 512)); 137 138 err = add_disk(dev->disk); 138 139 if (err)