diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-12 01:41:44 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-12 01:41:44 +0000 |
commit | 574360843474e90ea65fe9641f91e1b63be18a20 (patch) | |
tree | c7682928c0b4856b20d69e0287d20e01f5f773ca /chrome/browser/renderer_host | |
parent | 0700d1c7bd893e5daa81f3b181321a4c20d97702 (diff) | |
download | chromium_src-574360843474e90ea65fe9641f91e1b63be18a20.zip chromium_src-574360843474e90ea65fe9641f91e1b63be18a20.tar.gz chromium_src-574360843474e90ea65fe9641f91e1b63be18a20.tar.bz2 |
Render Helper would die in HandleLocaltime if passed an invalid time.
Check the output of localtime() before using it.
BUG=none
TEST=memory_test on 64bit Linux
Review URL: http://codereview.chromium.org/386012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31752 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/render_sandbox_host_linux.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/render_sandbox_host_linux.cc b/chrome/browser/renderer_host/render_sandbox_host_linux.cc index c27bb4b..f1c3b03 100644 --- a/chrome/browser/renderer_host/render_sandbox_host_linux.cc +++ b/chrome/browser/renderer_host/render_sandbox_host_linux.cc @@ -249,12 +249,17 @@ class SandboxIPCProcess { // out. Since we are a single-threaded process, this is safe. const struct tm* expanded_time = localtime(&time); - const std::string result_string( - reinterpret_cast<const char*>(expanded_time), sizeof(struct tm)); + std::string result_string; + const char* time_zone_string = ""; + if (expanded_time != NULL) { + result_string = std::string(reinterpret_cast<const char*>(expanded_time), + sizeof(struct tm)); + time_zone_string = expanded_time->tm_zone; + } Pickle reply; reply.WriteString(result_string); - reply.WriteString(expanded_time->tm_zone); + reply.WriteString(time_zone_string); SendRendererReply(fds, reply, -1); } |