wlfreerdp/cliprdr: Initialize pointer before use

In `wlf_cliprdr_server_format_data_request()` `ConvertToUnicode()` may return 0
while not allocating memory for `cdata` and not setting `cdata` to a valid
address. In this case, `data` points to a random address.

Settting `cdata` to NULL before calling `ConvertToUnicode()` fixes this issues.
This commit is contained in:
Sascha Wessel 2020-04-26 07:34:52 +02:00 committed by akallabeth
parent 11facf8909
commit 9867793d07
1 changed files with 1 additions and 0 deletions

View File

@ -624,6 +624,7 @@ wlf_cliprdr_server_format_data_request(CliprdrClientContext* context,
rc = ERROR_INTERNAL_ERROR;
else
{
cdata = NULL;
cnv = ConvertToUnicode(CP_UTF8, 0, (LPCSTR)data, (int)size, &cdata, 0);
free(data);
data = NULL;