libfreerdp-utils: WideCharToMultiByte does not null-ternimate thus buffer must be zero.

This commit is contained in:
Vic Lee 2012-10-08 14:37:12 +08:00
parent b4fae1fc97
commit 956143e42b
1 changed files with 1 additions and 0 deletions

View File

@ -54,6 +54,7 @@ int freerdp_AsciiToUnicodeAlloc(const CHAR* str, WCHAR** wstr, int length)
int freerdp_UnicodeToAsciiAlloc(const WCHAR* wstr, CHAR** str, int length)
{
*str = malloc((length * 2) + 1);
memset(*str, 0, (length * 2) + 1);
WideCharToMultiByte(CP_UTF8, 0, wstr, length, *str, length, NULL, NULL);