mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[FREELDR] xboxmem: Fix array out-of-bounds access (#1775)
Memory map array should be large enough to fit additional descriptors. CORE-16216 CORE-16267
This commit is contained in:
committed by
Hermès BÉLUSCA - MAÏTO
parent
10c08e1d62
commit
2811d2f990
@@ -35,8 +35,6 @@ DBG_DEFAULT_CHANNEL(MEMORY);
|
||||
#define ULONGLONG_ALIGN_UP_BY(size, align) \
|
||||
(ULONGLONG_ALIGN_DOWN_BY(((ULONGLONG)(size) + align - 1), align))
|
||||
|
||||
#define MAX_BIOS_DESCRIPTORS 80ul
|
||||
|
||||
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS];
|
||||
ULONG PcBiosMapCount;
|
||||
|
||||
|
||||
@@ -89,12 +89,13 @@ XboxMemInit(VOID)
|
||||
AvailableMemoryMb = InstalledMemoryMb;
|
||||
}
|
||||
|
||||
FREELDR_MEMORY_DESCRIPTOR XboxMemoryMap[2];
|
||||
FREELDR_MEMORY_DESCRIPTOR XboxMemoryMap[MAX_BIOS_DESCRIPTORS + 1];
|
||||
|
||||
PFREELDR_MEMORY_DESCRIPTOR
|
||||
XboxMemGetMemoryMap(ULONG *MemoryMapSize)
|
||||
{
|
||||
TRACE("XboxMemGetMemoryMap()\n");
|
||||
/* FIXME: Obtain memory map via multiboot spec */
|
||||
|
||||
/* Synthesize memory map */
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#ifndef __ASM__
|
||||
|
||||
#define MAX_BIOS_DESCRIPTORS 80
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// ACPI 1.0.
|
||||
|
||||
Reference in New Issue
Block a user