Commit bd9d317e authored by jochen@chromium.org's avatar jochen@chromium.org

Don't crash if the tm_zone field returned by localtime is NULL

BUG=chromium:158355
R=svenpanne@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/662093003

Cr-Commit-Position: refs/heads/master@{#25129}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25129 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 50ecc645
......@@ -109,7 +109,7 @@ const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
if (std::isnan(time)) return "";
time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
struct tm* t = localtime(&tv);
if (NULL == t) return "";
if (!t || !t->tm_zone) return "";
return t->tm_zone;
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment