[winpr,sspi] allow empty NTLM passwords

This commit is contained in:
akallabeth 2024-10-26 08:53:19 +02:00
parent e560733f8e
commit 91a5f06ba3
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -333,14 +333,14 @@ static BOOL copy(WCHAR** dst, ULONG* dstLen, const WCHAR* what, size_t len)
*dst = NULL;
*dstLen = 0;
/* Case what="" and len=0 should allocate an empty string */
if (!what && (len != 0))
return FALSE;
if (len == 0)
return TRUE;
*dst = calloc(sizeof(WCHAR), len + 1);
if (!*dst)
return FALSE;
memcpy(*dst, what, len * sizeof(WCHAR));
if (what)
memcpy(*dst, what, len * sizeof(WCHAR));
*dstLen = len;
return TRUE;
}