Commit 79188582 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fix buffer overflow in _get_tzname.

parent 358fb2f4
...@@ -939,6 +939,11 @@ int CDECL MSVCRT__get_tzname(MSVCRT_size_t *ret, char *buf, MSVCRT_size_t bufsiz ...@@ -939,6 +939,11 @@ int CDECL MSVCRT__get_tzname(MSVCRT_size_t *ret, char *buf, MSVCRT_size_t bufsiz
*ret = strlen(timezone)+1; *ret = strlen(timezone)+1;
if(!buf && !bufsize) if(!buf && !bufsize)
return 0; return 0;
if(*ret > bufsize)
{
buf[0] = 0;
return MSVCRT_ERANGE;
}
strcpy(buf, timezone); strcpy(buf, timezone);
return 0; return 0;
......
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