mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTOS:MM] Fail on SizeOfRawData overflow. CORE-17284
Fixes the corresponding tests in ntdll_apitest:NtMapViewOfSection. Also add a TODO for the remaining test failures.
This commit is contained in:
parent
b957af4b6b
commit
e57a59a60a
1 changed files with 4 additions and 0 deletions
|
@ -723,12 +723,16 @@ l_ReadHeaderFromFile:
|
|||
// if(!IsAligned(pishSectionHeaders[i].PointerToRawData, nFileAlignment))
|
||||
// DIE(("PointerToRawData[%u] is not aligned\n", i));
|
||||
|
||||
if(!Intsafe_CanAddULong32(pishSectionHeaders[i].PointerToRawData, pishSectionHeaders[i].SizeOfRawData))
|
||||
DIE(("SizeOfRawData[%u] too large\n", i));
|
||||
|
||||
/* conversion */
|
||||
pssSegments[i].Image.FileOffset = pishSectionHeaders[i].PointerToRawData;
|
||||
pssSegments[i].RawLength.QuadPart = pishSectionHeaders[i].SizeOfRawData;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: Should reset PointerToRawData to 0 in the image mapping */
|
||||
ASSERT(pssSegments[i].Image.FileOffset == 0);
|
||||
ASSERT(pssSegments[i].RawLength.QuadPart == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue