[gateway] include '\0' in paa cookie string

This commit is contained in:
Armin Novak
2022-11-30 20:01:49 +01:00
committed by akallabeth
parent 2ad1469612
commit 97322c32ad

View File

@@ -1052,7 +1052,7 @@ static BOOL rdg_send_tunnel_request(rdpRdg* rdg)
return FALSE;
}
packetSize += 2 + (UINT32)PAACookieLen * sizeof(WCHAR);
packetSize += 2 + (UINT32)(PAACookieLen + 1) * sizeof(WCHAR);
fieldsPresent = HTTP_TUNNEL_PACKET_FIELD_PAA_COOKIE;
}
@@ -1073,7 +1073,7 @@ static BOOL rdg_send_tunnel_request(rdpRdg* rdg)
if (PAACookie)
{
Stream_Write_UINT16(s, (UINT16)PAACookieLen * 2); /* PAA cookie string length */
Stream_Write_UINT16(s, (UINT16)PAACookieLen * sizeof(WCHAR)); /* PAA cookie string length */
Stream_Write_UTF16_String(s, PAACookie, (size_t)PAACookieLen);
}