diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 60c7120f2fe..05980a54ea6 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -488,7 +488,7 @@ int CDECL MSVCRT__gmtime64_s(struct MSVCRT_tm *res, const MSVCRT___time64_t *sec SYSTEMTIME st; ULONGLONG time; - if (!res || !secs || *secs < 0) { + if (!res || !secs || *secs < 0 || *secs > _MAX__TIME64_T) { if (res) { write_invalid_msvcrt_tm(res); }