summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_system.cpp')
-rw-r--r--core/fxcrt/fx_system.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/fxcrt/fx_system.cpp b/core/fxcrt/fx_system.cpp
index af883882b1..83f761ff85 100644
--- a/core/fxcrt/fx_system.cpp
+++ b/core/fxcrt/fx_system.cpp
@@ -24,11 +24,12 @@ size_t FXSYS_wcsftime(wchar_t* strDest,
const struct tm* timeptr) {
// Avoid tripping an invalid parameter handler and crashing process.
// Note: leap seconds may cause tm_sec == 60.
- if (timeptr->tm_year < -1900 || timeptr->tm_mon < 0 || timeptr->tm_mon > 11 ||
- timeptr->tm_mday < 1 || timeptr->tm_mday > 31 || timeptr->tm_hour < 0 ||
- timeptr->tm_hour > 23 || timeptr->tm_min < 0 || timeptr->tm_min > 59 ||
- timeptr->tm_sec < 0 || timeptr->tm_sec > 60 || timeptr->tm_wday < 0 ||
- timeptr->tm_wday > 6 || timeptr->tm_yday < 0 || timeptr->tm_yday > 365) {
+ if (timeptr->tm_year < -1900 || timeptr->tm_year > 8099 ||
+ timeptr->tm_mon < 0 || timeptr->tm_mon > 11 || timeptr->tm_mday < 1 ||
+ timeptr->tm_mday > 31 || timeptr->tm_hour < 0 || timeptr->tm_hour > 23 ||
+ timeptr->tm_min < 0 || timeptr->tm_min > 59 || timeptr->tm_sec < 0 ||
+ timeptr->tm_sec > 60 || timeptr->tm_wday < 0 || timeptr->tm_wday > 6 ||
+ timeptr->tm_yday < 0 || timeptr->tm_yday > 365) {
strDest[0] = L'\0';
return 0;
}