[winpr,sam] fix inalid NULL arguments

This commit is contained in:
Armin Novak 2023-01-11 21:07:59 +01:00 committed by akallabeth
parent 39210d1efd
commit 2d16ab5255

View File

@ -57,8 +57,10 @@ static WINPR_SAM_ENTRY* SamEntryFromDataA(LPCSTR User, DWORD UserLength, LPCSTR
WINPR_SAM_ENTRY* entry = calloc(1, sizeof(WINPR_SAM_ENTRY));
if (!entry)
return NULL;
if (User && (UserLength > 0))
entry->User = _strdup(User);
entry->UserLength = UserLength;
if (Domain && (DomainLength > 0))
entry->Domain = _strdup(Domain);
entry->DomainLength = DomainLength;
return entry;