mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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>
This commit is contained in:
parent
1ec3cca2d8
commit
aae636b546
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user