[NTOSKRNL] Use ExAllocatePoolWithQuotaTag() when allocating SystemBuffer for the IRP

That way, in case the system lacks memory, an exception is thrown and IRP isn't sent
to the device with NULL SystemBuffer.

CORE-14048
This commit is contained in:
Pierre Schweitzer 2017-11-26 14:01:04 +01:00
parent d01184b164
commit 9ecbbe2a33
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -516,9 +516,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
{
/* Allocate the System Buffer */
Irp->AssociatedIrp.SystemBuffer =
ExAllocatePoolWithTag(PoolType,
BufferLength,
TAG_SYS_BUF);
ExAllocatePoolWithQuotaTag(PoolType,
BufferLength,
TAG_SYS_BUF);
/* Check if we got a buffer */
if (InputBuffer)
@ -563,9 +563,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
{
/* Allocate the System Buffer */
Irp->AssociatedIrp.SystemBuffer =
ExAllocatePoolWithTag(PoolType,
InputBufferLength,
TAG_SYS_BUF);
ExAllocatePoolWithQuotaTag(PoolType,
InputBufferLength,
TAG_SYS_BUF);
/* Copy into the System Buffer */
RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,