mirror of https://github.com/FreeRDP/FreeRDP
winpr/sspi: fixed test TestInitializeSecurityContext
This commit is contained in:
parent
e4aef1b07f
commit
1519152709
|
@ -98,6 +98,9 @@ size_t _wcslen(const WCHAR* str)
|
|||
{
|
||||
WCHAR* p = (WCHAR*) str;
|
||||
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
while (*p)
|
||||
p++;
|
||||
|
||||
|
|
|
@ -63,6 +63,11 @@ void ntlm_SetContextWorkstation(NTLM_CONTEXT* context, char* Workstation)
|
|||
void ntlm_SetContextServicePrincipalNameW(NTLM_CONTEXT* context, LPWSTR ServicePrincipalName)
|
||||
{
|
||||
context->ServicePrincipalName.Length = _wcslen(ServicePrincipalName) * 2;
|
||||
if (!ServicePrincipalName)
|
||||
{
|
||||
context->ServicePrincipalName.Buffer = NULL;
|
||||
return;
|
||||
}
|
||||
context->ServicePrincipalName.Buffer = (PWSTR) malloc(context->ServicePrincipalName.Length + 2);
|
||||
CopyMemory(context->ServicePrincipalName.Buffer, ServicePrincipalName, context->ServicePrincipalName.Length + 2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue