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

Unified Diff: mojo/public/cpp/bindings/lib/fixed_buffer.cc

Issue 229203003: Make mojo buffer allocators more robust. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tidy a little. Created 6 years, 8 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
Index: mojo/public/cpp/bindings/lib/fixed_buffer.cc
diff --git a/mojo/public/cpp/bindings/lib/fixed_buffer.cc b/mojo/public/cpp/bindings/lib/fixed_buffer.cc
index 7e19ae27bd21934fadc3ff49d8e18a764683a4cb..53967eb43d91e50dd3a1e3faafa154fca6913311 100644
--- a/mojo/public/cpp/bindings/lib/fixed_buffer.cc
+++ b/mojo/public/cpp/bindings/lib/fixed_buffer.cc
@@ -19,6 +19,7 @@ FixedBuffer::FixedBuffer(size_t size)
: ptr_(NULL),
cursor_(0),
size_(internal::Align(size)) {
+ // calloc() required to zero memory and thus avoid info leaks.
ptr_ = static_cast<char*>(calloc(size_, 1));
}
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/scratch_buffer.h » ('j') | mojo/public/cpp/bindings/lib/scratch_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698