mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-12-05 07:43:58 +08:00
There is no reason to restrict nSize to 2 the hostname can be empty on
UNIX-like machines.
This commit is contained in:
parent
a9ecd6a6cc
commit
00374382d9
@ -255,8 +255,7 @@ BOOL settings_get_computer_name(rdpSettings* settings)
|
||||
DWORD nSize = 0;
|
||||
CHAR* computerName;
|
||||
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || (GetLastError() != ERROR_MORE_DATA) ||
|
||||
(nSize < 2))
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || GetLastError() != ERROR_MORE_DATA)
|
||||
return FALSE;
|
||||
|
||||
computerName = calloc(nSize, sizeof(CHAR));
|
||||
|
@ -52,8 +52,7 @@ static int ntlm_SetContextWorkstation(NTLM_CONTEXT* context, char* Workstation)
|
||||
|
||||
if (!Workstation)
|
||||
{
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || (GetLastError() != ERROR_MORE_DATA) ||
|
||||
(nSize < 2))
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || GetLastError() != ERROR_MORE_DATA)
|
||||
return -1;
|
||||
|
||||
computerName = calloc(nSize, sizeof(CHAR));
|
||||
@ -133,8 +132,7 @@ static int ntlm_SetContextTargetName(NTLM_CONTEXT* context, char* TargetName)
|
||||
|
||||
if (!name)
|
||||
{
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || (GetLastError() != ERROR_MORE_DATA) ||
|
||||
(nSize < 2))
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || GetLastError() != ERROR_MORE_DATA)
|
||||
return -1;
|
||||
|
||||
computerName = calloc(nSize, sizeof(CHAR));
|
||||
|
@ -180,8 +180,7 @@ int ntlm_get_target_computer_name(PUNICODE_STRING pName, COMPUTER_NAME_FORMAT ty
|
||||
DWORD nSize = 0;
|
||||
CHAR* computerName;
|
||||
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || (GetLastError() != ERROR_MORE_DATA) ||
|
||||
(nSize < 2))
|
||||
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) || GetLastError() != ERROR_MORE_DATA)
|
||||
return -1;
|
||||
|
||||
computerName = calloc(nSize, sizeof(CHAR));
|
||||
|
Loading…
Reference in New Issue
Block a user