diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2026-03-18 03:16:33 +0300 |
|---|---|---|
| committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2026-04-08 12:15:21 +0300 |
| commit | 59747bec5d6e00a83ce5dfc8f7ac9b7113a11472 (patch) | |
| tree | ae25ca805a0e248692f0652fca962a6f660b5c06 | |
| parent | 5247c783dc11eba298b3a6c03470125a67bf8cda (diff) | |
| download | linux-59747bec5d6e00a83ce5dfc8f7ac9b7113a11472.tar.xz | |
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>
| -rw-r--r-- | arch/m68k/emu/nfblock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c index 93536cf2a38e..fa6256c5af22 100644 --- a/arch/m68k/emu/nfblock.c +++ b/arch/m68k/emu/nfblock.c @@ -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) |
