[FASTFAT] Fix FastFAT not returning short name for FAT volumes in FileBothDirectoryInformation case

This is likely due to a copy paste error where long name was copied twice and short never.
Fun fact: this was not affecting FATX volumes
Fun fact2: this was defeating a buffer overflow check and thus was allowing buffer overflow!

CORE-14088
This commit is contained in:
Pierre Schweitzer 2017-12-09 21:22:55 +01:00
parent 48250aef6e
commit 18d6584da4
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -427,9 +427,10 @@ VfatGetFileBothInformation(
{
pInfo->ShortNameLength = (CCHAR)DirContext->ShortNameU.Length;
RtlCopyMemory(pInfo->FileName,
DirContext->LongNameU.Buffer,
DirContext->LongNameU.Length);
ASSERT(pInfo->ShortNameLength / sizeof(WCHAR) <= 12);
RtlCopyMemory(pInfo->ShortName,
DirContext->ShortNameU.Buffer,
DirContext->ShortNameU.Length);
/* pInfo->FileIndex = ; */