https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9ecbbe2a338619c9d9f7c…
commit 9ecbbe2a338619c9d9f7c52a6e7af24adc5fb174
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Nov 26 14:01:04 2017 +0100
[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
---
ntoskrnl/io/iomgr/iofunc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c
index bde78e4f96..19f54e070d 100644
--- a/ntoskrnl/io/iomgr/iofunc.c
+++ b/ntoskrnl/io/iomgr/iofunc.c
@@ -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,