proxy: Fix unicode flag parsing in proxy rdpdr client name request

Only the least significant bit is valid in the unicode flag UINT32. Some
clients send garbage data in the other bits which caused the proxy to
drop the connection which is wrong.
This commit is contained in:
Martin Fleisz 2022-09-08 10:20:43 +02:00 committed by David Fort
parent 6b62ce9200
commit fd96ed0acd
1 changed files with 1 additions and 14 deletions

View File

@ -394,20 +394,7 @@ static UINT rdpdr_process_client_name_request(pf_channel_server_context* rdpdr,
return ERROR_INVALID_DATA;
Stream_Read_UINT32(s, unicodeFlag);
switch (unicodeFlag)
{
case 1:
rdpdr->common.computerNameUnicode = TRUE;
break;
case 0:
rdpdr->common.computerNameUnicode = FALSE;
break;
default:
WLog_WARN(TAG, "[%s | %s]: Invalid unicodeFlag value 0x%08" PRIx32,
rdpdr_component_string(RDPDR_CTYP_CORE),
rdpdr_packetid_string(PAKID_CORE_CLIENT_NAME), unicodeFlag);
return ERROR_INVALID_DATA;
}
rdpdr->common.computerNameUnicode = (unicodeFlag & 1);
Stream_Read_UINT32(s, codePage);
WINPR_UNUSED(codePage); /* Field is ignored */