[NTOSKRNL]

Fix a bug in MiAllocatePoolPages, that made the function succeed, when MAX_ULONG / -1 / 0xFFFFFFFF bytes were requested. The value overflowed into 0 and 0 pages were returned. When freeing this block, it could either free the next following large allocation or ASSERT when the end of the pool was reached without finding the end of the allocation.
Fixes FoxitReader 4.2/4.3

svn path=/trunk/; revision=56366
This commit is contained in:
Timo Kreuzer 2012-04-19 14:33:53 +00:00
parent daedde8ad3
commit a9d728c50a

View file

@ -437,6 +437,17 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
//
SizeInPages = (PFN_COUNT)BYTES_TO_PAGES(SizeInBytes);
//
// Check for overflow
//
if (SizeInPages == 0)
{
//
// Fail
//
return NULL;
}
//
// Handle paged pool
//