diff options
| author | Maxwell Doose <m32285159@gmail.com> | 2026-06-03 09:52:21 -0500 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-06-11 11:42:20 -0700 |
| commit | aae636b5463d9957fadba71e83e7cfc157416974 (patch) | |
| tree | 6342e3810c65787e45c8e8cc13bd1a2754748c9b /fs/fat | |
| parent | 1ec3cca2d8b6b9ff6584ca626d4c8918bbf48d44 (diff) | |
fs: fat: inode: replace sprintf() with scnprintf()
The kernel documentation notes that sprintf() is deprecated and unsafe.
Replace it with the more preferred scnprintf() to help with hardening.
Link: https://lore.kernel.org/20260603145222.59012-1-m32285159@gmail.com
Signed-off-by: Maxwell Doose <m32285159@gmail.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/fat')
| -rw-r--r-- | fs/fat/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 28f78df086ef..b032bbc6855c 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -1786,7 +1786,7 @@ int fat_fill_super(struct super_block *sb, struct fs_context *fc, */ error = -EINVAL; - sprintf(buf, "cp%d", sbi->options.codepage); + scnprintf(buf, sizeof(buf), "cp%d", sbi->options.codepage); sbi->nls_disk = load_nls(buf); if (!sbi->nls_disk) { fat_msg(sb, KERN_ERR, "codepage %s not found", buf); |
