mirror of
https://github.com/reactos/reactos.git
synced 2025-04-24 23:50:24 +00: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:
parent
de1fd1f76d
commit
d8316ddcfb
1 changed files with 18 additions and 1 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue