https://git.reactos.org/?p=reactos.git;a=commitdiff;h=007d3d382a27e9c2b0d63…
commit 007d3d382a27e9c2b0d63a35e3da0e09a2134847
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Dec 31 10:31:12 2017 +0100
[NTFS] Don't dereference NULL IRP
CID 1427057
---
drivers/filesystems/ntfs/rw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/filesystems/ntfs/rw.c b/drivers/filesystems/ntfs/rw.c
index 94d05de9ae..038caa4516 100644
--- a/drivers/filesystems/ntfs/rw.c
+++ b/drivers/filesystems/ntfs/rw.c
@@ -545,6 +545,9 @@ NtfsWrite(PNTFS_IRP_CONTEXT IrpContext)
DPRINT("NtfsWrite(IrpContext %p)\n", IrpContext);
ASSERT(IrpContext);
+ // get the I/O request packet
+ Irp = IrpContext->Irp;
+
// This request is not allowed on the main device object
if (IrpContext->DeviceObject == NtfsGlobalData->DeviceObject)
{
@@ -554,9 +557,6 @@ NtfsWrite(PNTFS_IRP_CONTEXT IrpContext)
return STATUS_INVALID_DEVICE_REQUEST;
}
- // get the I/O request packet
- Irp = IrpContext->Irp;
-
// get the File control block
Fcb = (PNTFS_FCB)IrpContext->FileObject->FsContext;
ASSERT(Fcb);