Module: wine Branch: stable Commit: b26f35d9ef891da33ab0486d33b151dba106f1ea URL: https://source.winehq.org/git/wine.git/?a=commit;h=b26f35d9ef891da33ab0486d3...
Author: Piotr Caban piotr@codeweavers.com Date: Wed Feb 27 18:37:10 2019 +0100
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 79188582f067b16e3aaebfad4a853d84f3a310cc) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/msvcrt/time.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 14f4ba0..e6493b0 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -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;