Skip to content
Snippets Groups Projects
Commit 605ecafa authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard
Browse files

user32: Fix a SetClipboardData() buffer overflow.

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.
parent ee4f8cbb
No related branches found
No related tags found
1 merge request!1877user32: Clipboard overflow and underflow fixes
Pipeline #6788 skipped
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment