[NTDLL] check for NULL buffer in LdrpLoadDll

This happens in advapi32_apitest in Test_CreateOpenKey.
This commit is contained in:
Timo Kreuzer 2025-02-01 15:22:13 +02:00
parent 486ab63862
commit 90dce9340c

View file

@ -2423,6 +2423,12 @@ LdrpLoadDll(IN BOOLEAN Redirected,
PLDR_DATA_TABLE_ENTRY LdrEntry;
BOOLEAN InInit = LdrpInLdrInit;
if (DllName->Buffer == NULL)
{
DPRINT1("DllName->Buffer is NULL!\n");
return STATUS_INVALID_PARAMETER;
}
/* Save the Raw DLL Name */
if (DllName->Length >= sizeof(NameBuffer)) return STATUS_NAME_TOO_LONG;
RtlInitEmptyUnicodeString(&RawDllName, NameBuffer, sizeof(NameBuffer));