fs: exfat: Use strncpy() and bail on too long filenames
authorMarek Vasut <marex@denx.de>
Wed, 30 Apr 2025 16:45:51 +0000 (18:45 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 5 May 2025 20:19:20 +0000 (14:19 -0600)
commit4ba2fe14f2cecf7b614220e8e19c1fcdda92b748
treee29bdfe6cf6941ff1217d88d738941d9d02924c5
parent1c26f91a224b7ce222314b38c068acd1833599f4
fs: exfat: Use strncpy() and bail on too long filenames

In case the filename is too long, longer than PATH_MAX - 1, it
would overflow dirs->dirname array. Add missing check and also
use strncpy() to prevent the overflow in any case.

Fixes CID 550305:  Security best practices violations  (STRING_OVERFLOW)

Signed-off-by: Marek Vasut <marex@denx.de>
fs/exfat/io.c