Fix a buffer overrun that was corrupting the FCB.
See issue #4086 for more details.

svn path=/trunk/; revision=54072
This commit is contained in:
Kamil Hornicek 2011-10-10 13:37:19 +00:00
parent 756c9d6dc2
commit 48afa1dc33

View file

@ -325,7 +325,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt,
DPRINT("PathName '%S' ObjectName '%S'\n", Fcb->PathName, Fcb->ObjectName);
memcpy(&Fcb->Entry, Record, sizeof(DIR_RECORD));
wcsncpy(Fcb->ObjectName, name, MAX_PATH);
wcsncpy(Fcb->ObjectName, name, min(wcslen(name) + 1,
MAX_PATH - wcslen(Fcb->PathName) + wcslen(Fcb->ObjectName)));
/* Copy short name */
Fcb->ShortNameU.Length = ShortName.Length;