[NTOSKRNL] Use captured variable to check parameters in NtRead/WriteFile
authorPierre Schweitzer <pierre@reactos.org>
Thu, 4 Oct 2018 08:27:35 +0000 (10:27 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 4 Oct 2018 08:45:10 +0000 (10:45 +0200)
ntoskrnl/io/iomgr/iofunc.c

index b90e73f..01a9565 100644 (file)
@@ -2633,7 +2633,7 @@ NtReadFile(IN HANDLE FileHandle,
                 {
                     /* Fail if ByteOffset is not sector size aligned */
                     if ((DeviceObject->SectorSize != 0) &&
-                        (ByteOffset->QuadPart % DeviceObject->SectorSize != 0))
+                        (CapturedByteOffset.QuadPart % DeviceObject->SectorSize != 0))
                     {
                         /* Release the file object and and fail */
                         ObDereferenceObject(FileObject);
@@ -3670,11 +3670,11 @@ NtWriteFile(IN HANDLE FileHandle,
                 {
                     /* Fail if ByteOffset is not sector size aligned */
                     if ((DeviceObject->SectorSize != 0) &&
-                        (ByteOffset->QuadPart % DeviceObject->SectorSize != 0))
+                        (CapturedByteOffset.QuadPart % DeviceObject->SectorSize != 0))
                     {
                         /* Only if that's not specific values for synchronous IO */
-                        if ((ByteOffset->QuadPart != FILE_WRITE_TO_END_OF_FILE) &&
-                            (ByteOffset->QuadPart != FILE_USE_FILE_POINTER_POSITION ||
+                        if ((CapturedByteOffset.QuadPart != FILE_WRITE_TO_END_OF_FILE) &&
+                            (CapturedByteOffset.QuadPart != FILE_USE_FILE_POINTER_POSITION ||
                              !BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO)))
                         {
                             /* Release the file object and and fail */