msvcrt: Fix buffer overflow in _write function.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49770 Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ff1a4e0624
commit
427e2bb609
|
@ -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]))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue