winex11.drv: Fix use of uninitialized memory.

This commit is contained in:
Thomas Faller 2015-09-24 23:44:17 +02:00 committed by Alexandre Julliard
parent 93a685ad23
commit 587733855b
1 changed files with 13 additions and 2 deletions

View File

@ -367,8 +367,19 @@ static void intern_atoms(void)
i = 0; i = 0;
LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry )
if (!format->drvData) { if (!format->drvData) {
GetClipboardFormatNameW( format->wFormatID, buffer, 256 ); if (GetClipboardFormatNameW(format->wFormatID, buffer, 256) > 0)
len = WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, NULL, 0, NULL, NULL); {
/* use defined format name */
len = WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, NULL, 0, NULL, NULL);
}
else
{
/* create a name in the same way as ntdll/atom.c:integral_atom_name
* which is normally used by GetClipboardFormatNameW
*/
static const WCHAR fmt[] = {'#','%','u',0};
len = sprintfW(buffer, fmt, format->wFormatID) + 1;
}
names[i] = HeapAlloc(GetProcessHeap(), 0, len); names[i] = HeapAlloc(GetProcessHeap(), 0, len);
WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, names[i++], len, NULL, NULL); WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, names[i++], len, NULL, NULL);
} }