--- trunk/reactos/ntoskrnl/mm/marea.c 2005-03-20 11:35:39 UTC (rev 14213)
+++ trunk/reactos/ntoskrnl/mm/marea.c 2005-03-20 12:04:30 UTC (rev 14214)
@@ -491,7 +491,8 @@
/* 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;