From cf3b9d5b56e1b0cf435139736e44711c752ad621 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 29 Jul 2018 13:58:30 +0200 Subject: [PATCH] [NTOSKNRL] Only allocate a MDL if we have an output length For user mode, when probing output buffer, if it's null, length will also be set to 0. This avoids user mode applications being able to trigger various asserts in ReactOS (and thus BSOD when no debugger is plugged ;-)). --- ntoskrnl/io/iomgr/iofunc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index fa4886976d1..d119f851e1a 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -580,7 +580,7 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle, } /* Check if we got an output buffer */ - if (OutputBuffer) + if (OutputBufferLength) { /* Allocate the System Buffer */ Irp->MdlAddress = IoAllocateMdl(OutputBuffer,