Reviewers: Sven Panne,
Description:
Don't crash if the tm_zone field returned by localtime is NULL
BUG=chromium:158355
[email protected]
LOG=n
Please review this at https://codereview.chromium.org/662093003/
Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+1, -1 lines):
M src/base/platform/platform-linux.cc
Index: src/base/platform/platform-linux.cc
diff --git a/src/base/platform/platform-linux.cc
b/src/base/platform/platform-linux.cc
index
eff5ced3b75f4c6f993b7548b47fbaf5aee506e6..b13a1e85c540eadf54a23735482c67c8b3bd9c0a
100644
--- a/src/base/platform/platform-linux.cc
+++ b/src/base/platform/platform-linux.cc
@@ -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
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.