mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
winemac: Handle failure to get clipboard format name; don't use uninitialized buffer.
This commit is contained in:
parent
77ed56cffb
commit
cba4bcb47f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user