summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorjam <jam@chromium.org>2015-12-23 19:35:35 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-24 03:36:39 +0000
commit5b80cc34ca7e056ae2579ef5c5d859d50aaf559b (patch)
treefc68041bd7597e063d5cf331b02bfdec7e0803e7 /mojo
parentd351e5a2a8b8208b5c0b8a073beb29f8061d847c (diff)
downloadchromium_src-5b80cc34ca7e056ae2579ef5c5d859d50aaf559b.zip
chromium_src-5b80cc34ca7e056ae2579ef5c5d859d50aaf559b.tar.gz
chromium_src-5b80cc34ca7e056ae2579ef5c5d859d50aaf559b.tar.bz2
Clear memory of broker related structs sent over the new Mojo EDK.
Padding bytes weren't initialized which was causing dr memory errors. BUG=561803 TBR=yzshen@chromium.org Review URL: https://codereview.chromium.org/1548023002 Cr-Commit-Position: refs/heads/master@{#366795}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/edk/system/child_broker.cc1
-rw-r--r--mojo/edk/system/child_broker_host.cc2
2 files changed, 3 insertions, 0 deletions
diff --git a/mojo/edk/system/child_broker.cc b/mojo/edk/system/child_broker.cc
index 33c96bb..6903c82 100644
--- a/mojo/edk/system/child_broker.cc
+++ b/mojo/edk/system/child_broker.cc
@@ -106,6 +106,7 @@ void ChildBroker::ConnectMessagePipe(uint64_t pipe_id,
DCHECK(internal::g_io_thread_task_runner->RunsTasksOnCurrentThread());
ConnectMessagePipeMessage data;
+ memset(&data, 0, sizeof(data));
data.pipe_id = pipe_id;
if (pending_connects_.find(pipe_id) != pending_connects_.end()) {
if (!parent_async_channel_) {
diff --git a/mojo/edk/system/child_broker_host.cc b/mojo/edk/system/child_broker_host.cc
index 7d8208a..20a73d9 100644
--- a/mojo/edk/system/child_broker_host.cc
+++ b/mojo/edk/system/child_broker_host.cc
@@ -74,6 +74,7 @@ void ChildBrokerHost::ConnectToProcess(base::ProcessId process_id,
if (!child_channel_)
return; // Can happen at process shutdown on Windows.
ConnectToProcessMessage data;
+ memset(&data, 0, sizeof(data));
data.type = CONNECT_TO_PROCESS;
data.process_id = process_id;
scoped_ptr<MessageInTransit> message(new MessageInTransit(
@@ -94,6 +95,7 @@ void ChildBrokerHost::ConnectMessagePipe(uint64_t pipe_id,
if (!child_channel_)
return; // Can happen at process shutdown on Windows.
PeerPipeConnectedMessage data;
+ memset(&data, 0, sizeof(data));
data.type = PEER_PIPE_CONNECTED;
data.pipe_id = pipe_id;
data.process_id = process_id;