[NTOSKRNL]

Fix overflow

CID #701303

svn path=/trunk/; revision=62668
This commit is contained in:
Pierre Schweitzer 2014-04-06 17:18:55 +00:00
parent 0bd2bad093
commit 02d348bf34

View file

@ -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 */