[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 e76246c8a3
commit ad2a8b6253

View File

@@ -2428,6 +2428,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));