mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[NTDLL/LDR]
- Properly wrap potentially unsafe buffer usage into SEH. Spotted by Pierre. svn path=/trunk/; revision=53781
This commit is contained in:
parent
79722a1549
commit
e91d38160f
1 changed files with 14 additions and 14 deletions
|
@ -911,7 +911,7 @@ NTSTATUS
|
|||
NTAPI
|
||||
LdrQueryProcessModuleInformationEx(IN ULONG ProcessId,
|
||||
IN ULONG Reserved,
|
||||
IN PRTL_PROCESS_MODULES ModuleInformation,
|
||||
OUT PRTL_PROCESS_MODULES ModuleInformation,
|
||||
IN ULONG Size,
|
||||
OUT PULONG ReturnedSize OPTIONAL)
|
||||
{
|
||||
|
@ -929,21 +929,21 @@ LdrQueryProcessModuleInformationEx(IN ULONG ProcessId,
|
|||
/* Acquire loader lock */
|
||||
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
|
||||
|
||||
/* Check if we were given enough space */
|
||||
if (Size < UsedSize)
|
||||
{
|
||||
Status = STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
ModuleInformation->NumberOfModules = 0;
|
||||
ModulePtr = &ModuleInformation->Modules[0];
|
||||
Status = STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Traverse the list of modules */
|
||||
_SEH2_TRY
|
||||
{
|
||||
/* Check if we were given enough space */
|
||||
if (Size < UsedSize)
|
||||
{
|
||||
Status = STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
ModuleInformation->NumberOfModules = 0;
|
||||
ModulePtr = &ModuleInformation->Modules[0];
|
||||
Status = STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Traverse the list of modules */
|
||||
ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
|
||||
Entry = ModuleListHead->Flink;
|
||||
|
||||
|
|
Loading…
Reference in a new issue