From 9ddbcd95dd5c1e38a3b38cfc0c8c913a7610a8b9 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Wed, 23 Sep 2009 21:27:43 +0000 Subject: Fix an off by 1 error in the Linux Breakpad guid. BUG=22067 TEST=No more random strings in crash client GUIDs. Review URL: http://codereview.chromium.org/213038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26991 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/breakpad_linux.cc | 2 +- chrome/browser/renderer_host/render_crash_handler_host_linux.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index 415db89..a9c11d7 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -576,7 +576,7 @@ RendererCrashHandler(const void* crash_context, size_t crash_context_size, const int fd = reinterpret_cast(context); int fds[2]; socketpair(AF_UNIX, SOCK_STREAM, 0, fds); - char guid[kGuidSize] = {0}; + char guid[kGuidSize + 1] = {0}; char crash_url[kMaxActiveURLSize + 1] = {0}; char distro[kDistroSize + 1] = {0}; const size_t guid_len = std::min(google_update::linux_guid.size(), diff --git a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc index ec83663..4e9fdf9 100644 --- a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc +++ b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc @@ -335,6 +335,9 @@ void RenderCrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) { HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL)); HANDLE_EINTR(close(signal_fd)); + // Sanitize the string data a bit more + guid[kGuidSize] = crash_url[kMaxActiveURLSize] = distro[kDistroSize] = 0; + BreakpadInfo info; info.filename = minidump_filename.c_str(); info.process_type = "renderer"; -- cgit v1.1