[FASTFAT]
authorEric Kohl <eric.kohl@reactos.org>
Fri, 1 May 2015 12:15:49 +0000 (12:15 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 1 May 2015 12:15:49 +0000 (12:15 +0000)
VfatRead: Check the Length before checking the ByteOffset because reading 0 bytes should always be successful.

svn path=/trunk/; revision=67492

reactos/drivers/filesystems/fastfat/rw.c

index 7278481..04ab297 100644 (file)
@@ -599,6 +599,13 @@ VfatRead(
        goto ByeBye;
     }
 
+    if (Length == 0)
+    {
+        IrpContext->Irp->IoStatus.Information = 0;
+        Status = STATUS_SUCCESS;
+        goto ByeBye;
+    }
+
     if (ByteOffset.QuadPart >= Fcb->RFCB.FileSize.QuadPart)
     {
        IrpContext->Irp->IoStatus.Information = 0;
@@ -617,13 +624,6 @@ VfatRead(
         }
     }
 
-    if (Length == 0)
-    {
-        IrpContext->Irp->IoStatus.Information = 0;
-        Status = STATUS_SUCCESS;
-        goto ByeBye;
-    }
-
     if (Fcb->Flags & FCB_IS_VOLUME)
     {
         Resource = &IrpContext->DeviceExt->DirResource;