Skip to content

Commit

Permalink
Workaround for null char in cpu brand for WebRTC diagnostic log.
Browse files Browse the repository at this point in the history
Note: this is only a workaround for one piece of code using cpu brand.

BUG=249713

Review URL: https://chromiumcodereview.appspot.com/17073002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206415 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
grunell@chromium.org committed Jun 14, 2013
1 parent edff04d commit 171b01b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion chrome/browser/media/webrtc_logging_handler_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ void WebRtcLoggingHandlerHost::LogMachineInfo() {
", x" + IntToString(base::SysInfo::NumberOfProcessors()) + ", " +
IntToString(base::SysInfo::AmountOfPhysicalMemoryMB()) + "MB" + '\n';
pcb.Write(info.c_str(), info.length());
info = "Cpu brand: " + cpu.cpu_brand() + '\n';
std::string cpu_brand = cpu.cpu_brand();
// Workaround for crbug.com/249713.
size_t null_pos = cpu_brand.find('\0');
if (null_pos != std::string::npos)
cpu_brand.erase(null_pos);
info = "Cpu brand: " + cpu_brand + '\n';
pcb.Write(info.c_str(), info.length());

// Computer model
Expand Down

0 comments on commit 171b01b

Please sign in to comment.