[NTOS:MM]

- Consistently return STATUS_INVALID_IMAGE_PROTECT from PeFmtCreateSection if the PE signature is missing. Patch by V.
CORE-9618 #resolve

svn path=/trunk/; revision=67464
This commit is contained in:
Thomas Faber 2015-04-28 07:07:57 +00:00
parent 12c22c7748
commit 22d49c5df5

View file

@ -330,12 +330,14 @@ l_ReadHeaderFromFile:
{
ULONG cbOptHeaderOffsetSize = 0;
nStatus = STATUS_INVALID_IMAGE_FORMAT;
nStatus = STATUS_INVALID_IMAGE_PROTECT;
/* don't trust an invalid NT header */
if(pinhNtHeader->Signature != IMAGE_NT_SIGNATURE)
DIE(("The file isn't a PE executable, Signature is %X\n", pinhNtHeader->Signature));
nStatus = STATUS_INVALID_IMAGE_FORMAT;
if(!Intsafe_AddULong32(&cbOptHeaderOffsetSize, pidhDosHeader->e_lfanew, FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader)))
DIE(("The DOS stub is too large, e_lfanew is %X\n", pidhDosHeader->e_lfanew));