Commit cba4bcb4 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Handle failure to get clipboard format name; don't use uninitialized buffer.

parent 77ed56cf
......@@ -292,7 +292,13 @@ static WINE_CLIPFORMAT *insert_clipboard_format(UINT id, CFStringRef type)
{
WCHAR buffer[256];
GetClipboardFormatNameW(format->format_id, buffer, 256);
if (!GetClipboardFormatNameW(format->format_id, buffer, sizeof(buffer) / sizeof(buffer[0])))
{
WARN("failed to get name for format %s; error 0x%08x\n", debugstr_format(format->format_id), GetLastError());
HeapFree(GetProcessHeap(), 0, format);
return NULL;
}
if (!strncmpW(buffer, mac_type_name_prefix, strlenW(mac_type_name_prefix)))
{
const WCHAR *p = buffer + strlenW(mac_type_name_prefix);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment