Fix pointer operation overflow
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 36s
Builds / ExectOS (i686) (push) Successful in 36s

This commit is contained in:
Rafal Kupiec 2024-07-09 22:40:32 +02:00
parent e46f2e6116
commit 47219585d4
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -265,7 +265,7 @@ XTAPI
XTSTATUS XTSTATUS
HlpInitializeAcpiSystemInformation(VOID) HlpInitializeAcpiSystemInformation(VOID)
{ {
PUCHAR MadtTable; ULONG_PTR MadtTable;
PACPI_MADT Madt; PACPI_MADT Madt;
XTSTATUS Status; XTSTATUS Status;
ULONG CpuCount; ULONG CpuCount;
@ -282,11 +282,11 @@ HlpInitializeAcpiSystemInformation(VOID)
} }
/* Set APIC table traverse pointer and initialize number of CPUs */ /* Set APIC table traverse pointer and initialize number of CPUs */
MadtTable = (PUCHAR)Madt->ApicTables; MadtTable = (ULONG_PTR)Madt->ApicTables;
CpuCount = 0; CpuCount = 0;
/* Traverse all MADT tables to get number of processors */ /* Traverse all MADT tables to get number of processors */
while(MadtTable <= ((PUCHAR)Madt + Madt->Header.Length)) while(MadtTable <= ((ULONG_PTR)Madt + Madt->Header.Length))
{ {
/* Check if this is a local APIC subtable */ /* Check if this is a local APIC subtable */
if((((PACPI_MADT_LOCAL_APIC)MadtTable)->Header.Type == ACPI_MADT_TYPE_LOCAL_APIC) && if((((PACPI_MADT_LOCAL_APIC)MadtTable)->Header.Type == ACPI_MADT_TYPE_LOCAL_APIC) &&