mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +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:
parent
10c08e1d62
commit
2811d2f990
3 changed files with 4 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue