tst: winfsp-tests: ea_create_test

This commit is contained in:
Bill Zissimopoulos
2019-03-14 21:36:29 -07:00
parent 3553aec992
commit d59976bd5d
6 changed files with 144 additions and 9 deletions

View File

@ -441,10 +441,11 @@ NTSTATUS MemfsFileNodeSetEa(
if (0 != Ea->EaValueLength)
{
FileNodeEa = (FILE_FULL_EA_INFORMATION *)malloc(
sizeof *FileNodeEa + Ea->EaNameLength + Ea->EaValueLength);
FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + Ea->EaNameLength + 1 + Ea->EaValueLength);
if (0 == FileNodeEa)
return STATUS_INSUFFICIENT_RESOURCES;
memcpy(FileNodeEa, Ea, sizeof *FileNodeEa + Ea->EaNameLength + Ea->EaValueLength);
memcpy(FileNodeEa, Ea,
FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + Ea->EaNameLength + 1 + Ea->EaValueLength);
FileNodeEa->NextEntryOffset = 0;
}