Bug 730838 - Date.parse accepts non-zero milliseconds for ISO-8601 midnight representation. r=evilpies
authorEric Skoglund <eric@pagefault.se>
Tue, 24 May 2016 09:32:54 +0200
changeset 339430 fca24589e9666a482ba169a446f8f19eef66b841
parent 339429 dd6fb8e96ae4b9b2c2150e0515919ca8985b672b
child 339431 90a4cdcb559e200eee669ad9ae6f5840fb98bf62
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpies
bugs730838
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 730838 - Date.parse accepts non-zero milliseconds for ISO-8601 midnight representation. r=evilpies We forgot to check that the fraction part of second in the date was zero if the time is midnight. MozReview-Commit-ID: 7bMzFK8mBnO
js/src/jsdate.cpp
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -870,17 +870,17 @@ ParseISOStyleDate(const CharT* s, size_t
         isLocalTime = true;
     }
 
  done:
     if (year > 275943 // ceil(1e8/365) + 1970
         || (month == 0 || month > 12)
         || (day == 0 || day > size_t(DaysInMonth(year,month)))
         || hour > 24
-        || ((hour == 24) && (min > 0 || sec > 0))
+        || ((hour == 24) && (min > 0 || sec > 0 || frac > 0))
         || min > 59
         || sec > 59
         || tzHour > 23
         || tzMin > 59)
     {
         return false;
     }