mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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>
This commit is contained in:
committed by
Geert Uytterhoeven
parent
5247c783dc
commit
59747bec5d
@@ -132,7 +132,8 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
|
||||
dev->disk->minors = 16;
|
||||
dev->disk->fops = &nfhd_ops;
|
||||
dev->disk->private_data = dev;
|
||||
sprintf(dev->disk->disk_name, "nfhd%u", dev_id);
|
||||
snprintf(dev->disk->disk_name, sizeof(dev->disk->disk_name), "nfhd%u",
|
||||
dev_id);
|
||||
set_capacity(dev->disk, (sector_t)blocks * (bsize / 512));
|
||||
err = add_disk(dev->disk);
|
||||
if (err)
|
||||
|
||||
Reference in New Issue
Block a user