mirror of
https://github.com/reactos/reactos.git
synced 2026-07-05 19:44:26 +08:00
- Add a missing EA buffer validation.
- Free an EA buffer if it was allocated and error/exception happened. svn path=/trunk/; revision=38521
This commit is contained in:
@@ -1700,6 +1700,16 @@ IoCreateFile(OUT PHANDLE FileHandle,
|
||||
}
|
||||
|
||||
RtlCopyMemory(SystemEaBuffer, EaBuffer, EaLength);
|
||||
|
||||
/* Validate the buffer */
|
||||
Status = IoCheckEaBufferValidity(SystemEaBuffer,
|
||||
EaLength,
|
||||
&EaErrorOffset);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("FIXME: IoCheckEaBufferValidity() failed with "
|
||||
"Status: %lx\n",Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
@@ -1708,7 +1718,14 @@ IoCreateFile(OUT PHANDLE FileHandle,
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
if(!NT_SUCCESS(Status)) return Status;
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Free SystemEaBuffer if needed */
|
||||
if (SystemEaBuffer) ExFreePoolWithTag(SystemEaBuffer, TAG_EA);
|
||||
|
||||
/* Return failure status */
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user