mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 17:14:32 +00:00
[NTOSKRNL]
If we cannot read the file at offset e_lfanew, it means that the value of e_lfanew is invalid. svn path=/branches/ntvdm/; revision=63105
This commit is contained in:
parent
3a94de4a0e
commit
a31666e4e2
1 changed files with 8 additions and 1 deletions
|
@ -284,7 +284,14 @@ l_ReadHeaderFromFile:
|
||||||
nStatus = ReadFileCb(File, &lnOffset, sizeof(IMAGE_NT_HEADERS64), &pData, &pBuffer, &cbReadSize);
|
nStatus = ReadFileCb(File, &lnOffset, sizeof(IMAGE_NT_HEADERS64), &pData, &pBuffer, &cbReadSize);
|
||||||
|
|
||||||
if(!NT_SUCCESS(nStatus))
|
if(!NT_SUCCESS(nStatus))
|
||||||
DIE(("ReadFile failed, status %08X\n", nStatus));
|
{
|
||||||
|
NTSTATUS ReturnedStatus = nStatus;
|
||||||
|
|
||||||
|
/* If it attempted to read past the end of the file, it means e_lfanew is invalid */
|
||||||
|
if (ReturnedStatus == STATUS_END_OF_FILE) nStatus = STATUS_INVALID_IMAGE_FORMAT;
|
||||||
|
|
||||||
|
DIE(("ReadFile failed, status %08X\n", ReturnedStatus));
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT(pData);
|
ASSERT(pData);
|
||||||
ASSERT(pBuffer);
|
ASSERT(pBuffer);
|
||||||
|
|
Loading…
Reference in a new issue