mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 06:57:08 +00:00
[NTOS]: Fix a bug in MmFindGapBottomUp which could make it return an address lower than what the caller said should be the lowest address.
svn path=/trunk/; revision=49439
This commit is contained in:
parent
36429c0a64
commit
c7b69d59e3
|
@ -492,13 +492,16 @@ MmFindGapBottomUp(
|
|||
break;
|
||||
|
||||
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
|
||||
if (Node->StartingAddress > AlignedAddress &&
|
||||
(ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||
if (AlignedAddress >= LowestAddress)
|
||||
{
|
||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||
return AlignedAddress;
|
||||
if (Node->StartingAddress > AlignedAddress &&
|
||||
(ULONG_PTR)Node->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||
{
|
||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||
ASSERT(AlignedAddress >= LowestAddress);
|
||||
return AlignedAddress;
|
||||
}
|
||||
}
|
||||
|
||||
PreviousNode = Node;
|
||||
}
|
||||
|
||||
|
@ -508,6 +511,7 @@ MmFindGapBottomUp(
|
|||
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||
{
|
||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||
ASSERT(AlignedAddress >= LowestAddress);
|
||||
return AlignedAddress;
|
||||
}
|
||||
|
||||
|
@ -517,6 +521,7 @@ MmFindGapBottomUp(
|
|||
(ULONG_PTR)FirstNode->StartingAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||
{
|
||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||
ASSERT(AlignedAddress >= LowestAddress);
|
||||
return AlignedAddress;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue