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
{
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 = ; */