• Francois Gouget's avatar
    user32: Fix a SetClipboardData() buffer overflow. · 605ecafa
    Francois Gouget authored
    Wine would append a correctly aligned NUL Unicode character to
    terminate the string but overflow the buffer by one byte for odd-sized
    strings.
    Windows instead overwrites the last two buffer bytes with a NUL Unicode
    character which ends up being misaligned for odd-sized strings.
    The clipboard data has a size field anyway so match the Windows
    behavior.
    Tweak the tests to show that SetClipboardData() can overwrite half of
    the Unicode string's last character.
    605ecafa
clipboard.c 18.9 KB