[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 ;-)).
This commit is contained in:
Pierre Schweitzer
2018-07-29 13:58:30 +02:00
parent 30830ca963
commit cf3b9d5b56

View File

@@ -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,