kernelbase: Allow NULL lpAssemblyDirectoryName in find_actctx_dllpath.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Kevin Puetz 2020-02-05 20:00:50 +01:00 committed by Alexandre Julliard
parent b6e91fa44b
commit b064d32c52
1 changed files with 8 additions and 2 deletions

View File

@ -177,7 +177,7 @@ static NTSTATUS find_actctx_dllpath( const WCHAR *name, WCHAR **path )
/* restart with larger buffer */
}
if (!info->lpAssemblyManifestPath || !info->lpAssemblyDirectoryName)
if (!info->lpAssemblyManifestPath)
{
status = STATUS_SXS_KEY_NOT_FOUND;
goto done;
@ -188,7 +188,7 @@ static NTSTATUS find_actctx_dllpath( const WCHAR *name, WCHAR **path )
DWORD dirlen = info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
p++;
if (wcsnicmp( p, info->lpAssemblyDirectoryName, dirlen ) || wcsicmp( p + dirlen, dotManifestW ))
if (!dirlen || wcsnicmp( p, info->lpAssemblyDirectoryName, dirlen ) || wcsicmp( p + dirlen, dotManifestW ))
{
/* manifest name does not match directory name, so it's not a global
* windows/winsxs manifest; use the manifest directory name instead */
@ -205,6 +205,12 @@ static NTSTATUS find_actctx_dllpath( const WCHAR *name, WCHAR **path )
}
}
if (!info->lpAssemblyDirectoryName)
{
status = STATUS_SXS_KEY_NOT_FOUND;
goto done;
}
needed = (lstrlenW( windows_dir ) * sizeof(WCHAR) +
sizeof(winsxsW) + info->ulAssemblyDirectoryNameLength + 2*sizeof(WCHAR));