[NTOS:IO]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 5 Aug 2014 18:47:25 +0000 (18:47 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 5 Aug 2014 18:47:25 +0000 (18:47 +0000)
- Fail with the correct status code if MDL allocation fails
CORE-8410

svn path=/trunk/; revision=63812

reactos/ntoskrnl/io/iomgr/iofunc.c

index e283002..c7c62ab 100644 (file)
@@ -2350,6 +2350,8 @@ NtReadFile(IN HANDLE FileHandle,
             {
                 /* Allocate an MDL */
                 Mdl = IoAllocateMdl(Buffer, Length, FALSE, TRUE, Irp);
+                if (!Mdl)
+                    ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES);
                 MmProbeAndLockPages(Mdl, PreviousMode, IoWriteAccess);
             }
             _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -3269,6 +3271,8 @@ NtWriteFile(IN HANDLE FileHandle,
             {
                 /* Allocate an MDL */
                 Mdl = IoAllocateMdl(Buffer, Length, FALSE, TRUE, Irp);
+                if (!Mdl)
+                    ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES);
                 MmProbeAndLockPages(Mdl, PreviousMode, IoReadAccess);
             }
             _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)