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>
(cherry picked from commit 79188582f0)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Piotr Caban 2019-02-27 18:37:10 +01:00 committed by Michael Stefaniuc
parent 9d66116b9c
commit b26f35d9ef
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;