diff --git a/winpr/libwinpr/sspi/NTLM/ntlm.c b/winpr/libwinpr/sspi/NTLM/ntlm.c index 4803c4004..1d56de1ca 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm.c @@ -47,7 +47,7 @@ int ntlm_SetContextWorkstation(NTLM_CONTEXT* context, char* Workstation) int status; char* ws = Workstation; CHAR computerName[MAX_COMPUTERNAME_LENGTH + 1]; - DWORD nSize = sizeof(computerName) * sizeof(CHAR); + DWORD nSize = sizeof(computerName) / sizeof(CHAR); if (!Workstation) { @@ -108,12 +108,11 @@ int ntlm_SetContextTargetName(NTLM_CONTEXT* context, char* TargetName) { int status; CHAR computerName[MAX_COMPUTERNAME_LENGTH + 1]; - DWORD nSize = sizeof(computerName) * sizeof(CHAR); + DWORD nSize = sizeof(computerName) / sizeof(CHAR); char* name = TargetName; if (!name) { - if (!GetComputerNameExA(ComputerNameDnsHostname, computerName, &nSize)) return -1; diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c index 8e6ff8ab1..11657ca42 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c @@ -174,7 +174,7 @@ int ntlm_get_target_computer_name(PUNICODE_STRING pName, COMPUTER_NAME_FORMAT ty char* name; int status; CHAR computerName[MAX_COMPUTERNAME_LENGTH + 1]; - DWORD nSize = sizeof(computerName) * sizeof(CHAR); + DWORD nSize = sizeof(computerName) / sizeof(CHAR); if (!GetComputerNameExA(type, computerName, &nSize)) return -1;