From: Pierre Schweitzer Date: Sun, 29 Jul 2018 11:58:30 +0000 (+0200) Subject: [NTOSKNRL] Only allocate a MDL if we have an output length X-Git-Tag: 0.4.11-dev~257 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=cf3b9d5b56e1b0cf435139736e44711c752ad621 [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 ;-)). --- 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,