https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf6b5e1ceb7fdfd4850cf330115d74810c376b13

commit bf6b5e1ceb7fdfd4850cf330115d74810c376b13
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun Dec 30 14:45:29 2018 +0100
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Dec 30 15:26:43 2018 +0100

    [NTOS] Fix a NULL-pointer access bug.
---
 ntoskrnl/fstub/disksup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ntoskrnl/fstub/disksup.c b/ntoskrnl/fstub/disksup.c
index e7ab0a7990..dfdbf0c494 100644
--- a/ntoskrnl/fstub/disksup.c
+++ b/ntoskrnl/fstub/disksup.c
@@ -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))

Reply via email to