https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cf3b9d5b56e1b0cf435139736e44711c752ad621

commit cf3b9d5b56e1b0cf435139736e44711c752ad621
Author:     Pierre Schweitzer <pie...@reactos.org>
AuthorDate: Sun Jul 29 13:58:30 2018 +0200
Commit:     Pierre Schweitzer <pie...@reactos.org>
CommitDate: Sun Jul 29 13:58:30 2018 +0200

    [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 fa4886976d..d119f851e1 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,

Reply via email to