mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 13:21:39 +00:00
[NTOSKRNL]
Fix potential overflows CID #701302 CID #1206856 svn path=/trunk/; revision=63023
This commit is contained in:
parent
4bf9c9fbab
commit
5cabd6269f
1 changed files with 2 additions and 2 deletions
|
@ -1006,7 +1006,7 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk,
|
||||||
if ((Disk->SectorCount - 1ULL) != EfiHeader->AlternateLBA)
|
if ((Disk->SectorCount - 1ULL) != EfiHeader->AlternateLBA)
|
||||||
{
|
{
|
||||||
/* We'll update it. First, count number of sectors needed to store partitions */
|
/* We'll update it. First, count number of sectors needed to store partitions */
|
||||||
SectorsForPartitions = (EfiHeader->NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize;
|
SectorsForPartitions = ((ULONGLONG)EfiHeader->NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize;
|
||||||
/* Then set first usable LBA: Legacy MBR + GPT header + Partitions entries */
|
/* Then set first usable LBA: Legacy MBR + GPT header + Partitions entries */
|
||||||
EfiHeader->FirstUsableLBA = SectorsForPartitions + 2;
|
EfiHeader->FirstUsableLBA = SectorsForPartitions + 2;
|
||||||
/* Then set last usable LBA: Last sector - GPT header - Partitions entries */
|
/* Then set last usable LBA: Last sector - GPT header - Partitions entries */
|
||||||
|
@ -1313,7 +1313,7 @@ FstubVerifyPartitionTableEFI(IN PDISK_INFORMATION Disk,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute sectors taken by partitions */
|
/* Compute sectors taken by partitions */
|
||||||
SectorsForPartitions = ((EFIHeader->NumberOfEntries * PARTITION_ENTRY_SIZE) + Disk->SectorSize - 1) / Disk->SectorSize;
|
SectorsForPartitions = (((ULONGLONG)EFIHeader->NumberOfEntries * PARTITION_ENTRY_SIZE) + Disk->SectorSize - 1) / Disk->SectorSize;
|
||||||
if (PrimaryValid)
|
if (PrimaryValid)
|
||||||
{
|
{
|
||||||
WriteBackup = TRUE;
|
WriteBackup = TRUE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue