From 02d348bf34227a8c176546fd05bb9555ae04178e Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 17:18:55 +0000 Subject: [PATCH] [NTOSKRNL] Fix overflow CID #701303 svn path=/trunk/; revision=62668 --- reactos/ntoskrnl/fstub/fstubex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/fstub/fstubex.c b/reactos/ntoskrnl/fstub/fstubex.c index beb66fb254b..e864c1f09cd 100644 --- a/reactos/ntoskrnl/fstub/fstubex.c +++ b/reactos/ntoskrnl/fstub/fstubex.c @@ -2474,7 +2474,7 @@ IoWritePartitionTableEx(IN PDEVICE_OBJECT DeviceObject, NumberOfEntries = EfiHeader->NumberOfEntries; RtlCopyMemory(&DiskGuid, &EfiHeader->DiskGUID, sizeof(GUID)); /* Count number of sectors needed to store partitions */ - SectorsForPartitions = (NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize; + SectorsForPartitions = ((ULONGLONG)NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize; /* Set first usable LBA: Legacy MBR + GPT header + Partitions entries */ FirstUsableLBA = SectorsForPartitions + 2; /* Set last usable LBA: Last sector - GPT header - Partitions entries */