Commit 9df1bc57 authored by rockot's avatar rockot Committed by Commit bot

[mojo-edk] Initialize message buffers after alloc

We weren't zeroing the allocated memory before filling
the buffer. Due to padding this means there could be
uninitialized bytes. Bad news. Fixed.

Should fix failures on memory bots:

https://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Content%20Browser%20%28DrMemory%20full%29%20%284%29/builds/7154

BUG=None
TBR=thestig@chromium.org,darin@chromium.org

Review URL: https://codereview.chromium.org/1641493002

Cr-Commit-Position: refs/heads/master@{#371737}
parent 9b0d7173
...@@ -36,6 +36,7 @@ Channel::Message::Message(size_t payload_size, size_t num_handles) { ...@@ -36,6 +36,7 @@ Channel::Message::Message(size_t payload_size, size_t num_handles) {
data_ = static_cast<char*>(base::AlignedAlloc(size_, data_ = static_cast<char*>(base::AlignedAlloc(size_,
kChannelMessageAlignment)); kChannelMessageAlignment));
memset(data_, 0, size_);
header_ = reinterpret_cast<Header*>(data_); header_ = reinterpret_cast<Header*>(data_);
DCHECK_LE(size_, std::numeric_limits<uint32_t>::max()); DCHECK_LE(size_, std::numeric_limits<uint32_t>::max());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment