msvcrt: Fix buffer overflow in _get_tzname.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46481
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Piotr Caban 2019-02-27 18:37:10 +01:00 committed by Alexandre Julliard
parent 358fb2f4d8
commit 79188582f0
1 changed files with 5 additions and 0 deletions

View File

@ -939,6 +939,11 @@ int CDECL MSVCRT__get_tzname(MSVCRT_size_t *ret, char *buf, MSVCRT_size_t bufsiz
*ret = strlen(timezone)+1;
if(!buf && !bufsize)
return 0;
if(*ret > bufsize)
{
buf[0] = 0;
return MSVCRT_ERANGE;
}
strcpy(buf, timezone);
return 0;