Commit 8b021bb9 authored by Patrick Wildt's avatar Patrick Wildt Committed by Tom Rini
Browse files

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: default avatarPatrick Wildt <patrick@blueri.se>
parent cd80a4fe
......@@ -821,6 +821,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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment