Commit 427e2bb6 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fix buffer overflow in _write function.

parent ff1a4e06
......@@ -3504,7 +3504,8 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
}
#endif
for (; i < count && j < sizeof(conv)-1; i++, j++, len++)
for (; i < count && j < sizeof(conv)-1 &&
len < (sizeof(lfbuf) - 1) / sizeof(WCHAR); i++, j++, len++)
{
if (MSVCRT_isleadbyte((unsigned char)s[i]))
{
......
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