Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Unified Diff: components/crash/app/breakpad_linux.cc

Issue 649443002: Breakpad Linux: Fix flag value delimiter for ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compromised context memory usage Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/crash/app/breakpad_linux.cc
diff --git a/components/crash/app/breakpad_linux.cc b/components/crash/app/breakpad_linux.cc
index 622b4bae01beac7919716228f2c56b7f5dd12553..9375e05b8e65b0bc457263f67ebcc6bb8160c168 100644
--- a/components/crash/app/breakpad_linux.cc
+++ b/components/crash/app/breakpad_linux.cc
@@ -970,16 +970,33 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
uint64_t uid_str_length = my_uint64_len(uid);
my_uint64tos(uid_buf, uid, uid_str_length);
uid_buf[uid_str_length] = '\0';
+
+ size_t buf_len = my_strlen(dumpfile);
+ char* chrome_flag = reinterpret_cast<char*>(allocator->Alloc(buf_len + 10));
vapier 2014/10/13 19:50:50 this is C++ code, so why not just use std::string
stevefung 2014/10/13 20:15:13 I believe we can't use it, because this code runs
+ my_strlcat(chrome_flag, "--chrome=", 9);
Lei Zhang 2014/10/10 19:11:47 I think strlcat takes the size of the dest buffer,
stevefung 2014/10/13 22:28:39 Done.
+ my_strlcat(chrome_flag + 9, dumpfile, buf_len);
+
+ buf_len = my_strlen(pid_buf);
+ char* pid_flag = reinterpret_cast<char*>(allocator->Alloc(buf_len + 7));
+ my_strlcat(pid_flag, "--pid=", 6);
+ my_strlcat(pid_flag + 6, pid_buf, buf_len);
+
+ buf_len = my_strlen(uid_buf);
+ char* uid_flag = reinterpret_cast<char*>(allocator->Alloc(buf_len + 7));
+ my_strlcat(uid_flag, "--uid=", 6);
+ my_strlcat(uid_flag + 6, uid_buf, buf_len);
+
+ buf_len = my_strlen(exe_buf);
+ char* exe_flag = reinterpret_cast<char*>(allocator->Alloc(buf_len + 7));
+ my_strlcat(exe_flag, "--exe=", 6);
+ my_strlcat(exe_flag + 6, exe_buf, buf_len);
+
const char* args[] = {
kCrashReporterBinary,
- "--chrome",
- dumpfile,
- "--pid",
- pid_buf,
- "--uid",
- uid_buf,
- "--exe",
- exe_buf,
+ chrome_flag,
+ pid_flag,
+ uid_flag,
+ exe_flag,
NULL,
};
static const char msg[] = "Cannot upload crash dump: cannot exec "
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698