mirror of
https://github.com/reactos/reactos.git
synced 2024-07-12 23:55:07 +00:00
Fix a couple of off-by-one bugs we recently introduced -- PFNs are one of the only indexes which are actually 0-based, so you really want to loop from 0 to the last page, inclusive (unlike most loops where you would stop *before* the last element index).
svn path=/trunk/; revision=32362
This commit is contained in:
parent
ee3729d613
commit
99b1ac6cb9
|
@ -354,7 +354,7 @@ MmInitializePageList(IN ULONG_PTR FirstPhysKernelAddress,
|
||||||
KernelPageEnd = LastPhysKernelAddress / PAGE_SIZE;
|
KernelPageEnd = LastPhysKernelAddress / PAGE_SIZE;
|
||||||
|
|
||||||
/* Loop every page on the system */
|
/* Loop every page on the system */
|
||||||
for (i = 0; i < MmPageArraySize; i++)
|
for (i = 0; i <= MmPageArraySize; i++)
|
||||||
{
|
{
|
||||||
/* Check if it's part of RAM */
|
/* Check if it's part of RAM */
|
||||||
if (MiIsPfnRam(BIOSMemoryMap, AddressRangeCount, i))
|
if (MiIsPfnRam(BIOSMemoryMap, AddressRangeCount, i))
|
||||||
|
@ -417,7 +417,7 @@ MmInitializePageList(IN ULONG_PTR FirstPhysKernelAddress,
|
||||||
MmPageArray[i].MapCount = 1;
|
MmPageArray[i].MapCount = 1;
|
||||||
MmStats.NrSystemPages++;
|
MmStats.NrSystemPages++;
|
||||||
}
|
}
|
||||||
else if (i > (MiFreeDescriptor->BasePage + MiFreeDescriptor->PageCount - 1))
|
else if (i >= (MiFreeDescriptor->BasePage + MiFreeDescriptor->PageCount))
|
||||||
{
|
{
|
||||||
/* These are pages we allocated above to hold the PFN DB */
|
/* These are pages we allocated above to hold the PFN DB */
|
||||||
MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED;
|
MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED;
|
||||||
|
|
Loading…
Reference in a new issue