mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-31 19:26:42 +00:00
Fix nasty condition when we were subtracting AlignedAddress (which happened to be aligned to 0x80000000) from HighestAddress (which is MmSystemRangeStart - 1 == 0x7fffffff) and then using it for length comparsion.
svn path=/trunk/; revision=14214
This commit is contained in:
@@ -491,7 +491,8 @@ MmFindGapBottomUp(
|
||||
|
||||
/* Check if there is enough space after the last memory area. */
|
||||
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
|
||||
if ((ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||
if ((ULONG_PTR)HighestAddress > (ULONG_PTR)AlignedAddress &&
|
||||
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||
{
|
||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||
return AlignedAddress;
|
||||
|
||||
Reference in New Issue
Block a user