Revision: 25129
Author: [email protected]
Date: Wed Nov 5 08:30:59 2014 UTC
Log: Don't crash if the tm_zone field returned by localtime is NULL
BUG=chromium:158355
[email protected]
LOG=n
Review URL: https://codereview.chromium.org/662093003
https://code.google.com/p/v8/source/detail?r=25129
Modified:
/branches/bleeding_edge/src/base/platform/platform-linux.cc
=======================================
--- /branches/bleeding_edge/src/base/platform/platform-linux.cc Mon Sep 8
04:44:22 2014 UTC
+++ /branches/bleeding_edge/src/base/platform/platform-linux.cc Wed Nov 5
08:30:59 2014 UTC
@@ -109,7 +109,7 @@
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.