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>
*/
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);