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

commit 8f25e464c2147a6233d35b4fbc64279dd53280aa
Author:     Stanislav Motylkov <[email protected]>
AuthorDate: Sun Jul 28 19:20:53 2019 +0300
Commit:     Hermès BÉLUSCA - MAÏTO <[email protected]>
CommitDate: Sun Jul 28 18:20:53 2019 +0200

    [FREELDR] Trivial improvements (#1757)
    
    * [FREELDR] Fix uninitialized string in DiskGetBootPath()
    
    CORE-16216 CORE-16248
    
    * [FREELDR] xboxdisk: Add comment and fix code style
---
 boot/freeldr/freeldr/arch/i386/xboxdisk.c | 3 ++-
 boot/freeldr/freeldr/disk/disk.c          | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/boot/freeldr/freeldr/arch/i386/xboxdisk.c 
b/boot/freeldr/freeldr/arch/i386/xboxdisk.c
index c63f066551c..9e31ce9937d 100644
--- a/boot/freeldr/freeldr/arch/i386/xboxdisk.c
+++ b/boot/freeldr/freeldr/arch/i386/xboxdisk.c
@@ -30,6 +30,7 @@ DBG_DEFAULT_CHANNEL(DISK);
 #define XBOX_IDE_COMMAND_PORT 0x1f0
 #define XBOX_IDE_CONTROL_PORT 0x170
 
+/* BRFR signature at disk offset 0x600 */
 #define XBOX_SIGNATURE_SECTOR 3
 #define XBOX_SIGNATURE        ('B' | ('R' << 8) | ('F' << 16) | ('R' << 24))
 
@@ -479,7 +480,7 @@ XboxDiskGetPartitionEntry(UCHAR DriveNumber, ULONG 
PartitionNumber, PPARTITION_T
      * This is the Xbox, chances are that there is a Xbox-standard
      * partitionless disk in it so let's check that first.
      */
-    if (1 <= PartitionNumber && PartitionNumber <= sizeof(XboxPartitions) / 
sizeof(XboxPartitions[0]) &&
+    if (PartitionNumber >= 1 && PartitionNumber <= sizeof(XboxPartitions) / 
sizeof(XboxPartitions[0]) &&
         MachDiskReadLogicalSectors(DriveNumber, XBOX_SIGNATURE_SECTOR, 1, 
SectorData))
     {
         if (*((PULONG) SectorData) == XBOX_SIGNATURE)
diff --git a/boot/freeldr/freeldr/disk/disk.c b/boot/freeldr/freeldr/disk/disk.c
index 46da0be1f75..55701205248 100644
--- a/boot/freeldr/freeldr/disk/disk.c
+++ b/boot/freeldr/freeldr/disk/disk.c
@@ -104,6 +104,9 @@ BOOLEAN DiskGetBootPath(OUT PCHAR BootPath, IN ULONG Size)
     if (*FrldrBootPath)
         goto Done;
 
+    if (Size)
+        BootPath[0] = ANSI_NULL;
+
     /* 0x49 is our magic ramdisk drive, so try to detect it first */
     if (FrldrBootDrive == 0x49)
     {

Reply via email to