summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_system.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-16 13:48:19 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-16 20:59:51 +0000
commit2bf942d8c21b653efdfdcae681769cffbfaa0663 (patch)
tree64c3e323c0ac00736db643f9a06976a52501761c /core/fxcrt/fx_system.cpp
parent1e25e122849b0e16032f5b3d62bace4d3ce5253d (diff)
downloadpdfium-2bf942d8c21b653efdfdcae681769cffbfaa0663.tar.xz
Avoid a crash inside wcsftime() on Windows.chromium/3135chromium/3134chromium/3133
BUG=chromium:733245 Change-Id: Ic9347e2cc245831c0b71fac1d531c33c5646ab3f Reviewed-on: https://pdfium-review.googlesource.com/6671 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_system.cpp')
-rw-r--r--core/fxcrt/fx_system.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxcrt/fx_system.cpp b/core/fxcrt/fx_system.cpp
index cf1c7e5920..af883882b1 100644
--- a/core/fxcrt/fx_system.cpp
+++ b/core/fxcrt/fx_system.cpp
@@ -24,7 +24,7 @@ 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 < 0 || timeptr->tm_mon < 0 || timeptr->tm_mon > 11 ||
+ 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 ||