Skip to content

Commit 59747be

Browse files
tobluxgeertu
authored andcommitted
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>
1 parent 5247c78 commit 59747be

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/m68k/emu/nfblock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
132132
dev->disk->minors = 16;
133133
dev->disk->fops = &nfhd_ops;
134134
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);
136137
set_capacity(dev->disk, (sector_t)blocks * (bsize / 512));
137138
err = add_disk(dev->disk);
138139
if (err)

0 commit comments

Comments
 (0)