[NTOS] Fix a NULL-pointer access bug.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 30 Dec 2018 13:45:29 +0000 (14:45 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 30 Dec 2018 14:26:43 +0000 (15:26 +0100)
ntoskrnl/fstub/disksup.c

index e7ab0a7..dfdbf0c 100644 (file)
@@ -1392,7 +1392,6 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
     BOOLEAN IsValid, IsEmpty = TRUE;
     PVOID MbrBuffer;
     PIO_STACK_LOCATION IoStackLocation;
-    PBOOT_SECTOR_INFO BootSectorInfo = (PBOOT_SECTOR_INFO)Buffer;
     UCHAR PartitionType;
     LARGE_INTEGER HiddenSectors64;
     VolumeOffset.QuadPart = Offset.QuadPart = 0;
@@ -1723,6 +1722,8 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
     if ((DiskGeometry.MediaType == RemovableMedia) &&
         (j == 0) && (MbrFound) && (IsEmpty))
     {
+        PBOOT_SECTOR_INFO BootSectorInfo = (PBOOT_SECTOR_INFO)Buffer;
+
         /* Read the jump bytes to detect super-floppy */
         if ((BootSectorInfo->JumpByte[0] == 0xeb) ||
             (BootSectorInfo->JumpByte[0] == 0xe9))