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 " |