[winpr,sam] allow empty domain in SamLookupUserW

This commit is contained in:
Armin Novak 2023-01-11 19:52:33 +01:00 committed by akallabeth
parent c2cd88d616
commit 39210d1efd

View File

@ -340,9 +340,12 @@ WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPCWSTR User, UINT32 UserLength,
utfUser = ConvertWCharNToUtf8Alloc(User, UserLength / sizeof(WCHAR), &userCharLen);
if (!utfUser)
goto fail;
utfDomain = ConvertWCharNToUtf8Alloc(Domain, DomainLength / sizeof(WCHAR), &domainCharLen);
if (!utfDomain)
goto fail;
if (DomainLength > 0)
{
utfDomain = ConvertWCharNToUtf8Alloc(Domain, DomainLength / sizeof(WCHAR), &domainCharLen);
if (!utfDomain)
goto fail;
}
entry = SamLookupUserA(sam, utfUser, userCharLen, utfDomain, domainCharLen);
fail:
free(utfUser);