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

Unified Diff: mojo/edk/system/channel.cc

Issue 1684733004: [mojo-edk]: zero message buffer on allocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: mojo/edk/system/channel.cc
diff --git a/mojo/edk/system/channel.cc b/mojo/edk/system/channel.cc
index bfb8c32dcfea20551fc4ce6a106a5605297fa496..2d6142e3a6abc4d1741e2d0b491b6893b8b5b813 100644
--- a/mojo/edk/system/channel.cc
+++ b/mojo/edk/system/channel.cc
@@ -38,6 +38,7 @@ Channel::Message::Message(size_t payload_size,
data_ = static_cast<char*>(base::AlignedAlloc(size_,
kChannelMessageAlignment));
+ memset(data_, 0, size_);
header_ = reinterpret_cast<Header*>(data_);
DCHECK_LE(size_, std::numeric_limits<uint32_t>::max());
« 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