mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 15:08:14 +00:00
[NTDLL:LDR] Fail if section creation fails in LdrpCreateDllSection. CORE-17284
Otherwise we'd call ZwQuerySection on an invalid handle and get: (ntoskrnl/mm/section.c:4320) Failed to reference section: 0xc0000008 Also correctly check DllCharacteristics: If the argument is missing, the file is _not_ a system file, i.e. we should check for restrictions.
This commit is contained in:
parent
2e1aeb12df
commit
1c404d838a
1 changed files with 4 additions and 1 deletions
|
@ -641,10 +641,12 @@ LdrpCreateDllSection(IN PUNICODE_STRING FullName,
|
||||||
|
|
||||||
/* Increment the error count */
|
/* Increment the error count */
|
||||||
if (LdrpInLdrInit) LdrpFatalHardErrorCount++;
|
if (LdrpInLdrInit) LdrpFatalHardErrorCount++;
|
||||||
|
|
||||||
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for Safer restrictions */
|
/* Check for Safer restrictions */
|
||||||
if (DllCharacteristics &&
|
if (!DllCharacteristics ||
|
||||||
!(*DllCharacteristics & IMAGE_FILE_SYSTEM))
|
!(*DllCharacteristics & IMAGE_FILE_SYSTEM))
|
||||||
{
|
{
|
||||||
/* Make sure it's executable */
|
/* Make sure it's executable */
|
||||||
|
@ -683,6 +685,7 @@ LdrpCreateDllSection(IN PUNICODE_STRING FullName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Exit:
|
||||||
/* Close the file handle, we don't need it */
|
/* Close the file handle, we don't need it */
|
||||||
NtClose(FileHandle);
|
NtClose(FileHandle);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue