fs: fix FAT name extraction
PATCH 1/1 fs: fix FAT name extraction
The long name apparently can be accumulated using multiple 13-byte slots. Unfortunately we never checked how many we can actually fit in the buffer we are reading to.
Signed-off-by Patrick Wildt <[email protected]>
--- fs/fat/fat.c | 3 +++ 1 file changed, 3 insertions(+)
fs/fat/fat.c +3 -0
@@ -810,6 +810,9 @@ static dir_entry *extract_vfat_name(fat_itr *itr)slot2str ((dir_slot *)dent, buf, &idx); +if (n + idx >=sizeof (itr->l_name)) +return NULL ; +/* shift accumulated long-name up and copy new part in: */ memmove (itr->l_name + idx, itr->l_name, n);memcpy (itr->l_name, buf, idx);
Signature · 1 line
2.17.2 (Apple Git-113)
Quoted 5 lines · Patrick Wildt
The long name apparently can be accumulated using multiple 13-byte slots. Unfortunately we never checked how many we can actually fit in the buffer we are reading to.
Signed-off-by Patrick Wildt <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181207/c766e288/attachment.sig>