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

Unified Diff: base/shared_memory_android.cc

Issue 11446048: The correct type for the size of a chunk of memory is size_t. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | « base/shared_memory.h ('k') | base/shared_memory_nacl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory_android.cc
===================================================================
--- base/shared_memory_android.cc (revision 175576)
+++ base/shared_memory_android.cc (working copy)
@@ -19,6 +19,9 @@
bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
DCHECK_EQ(-1, mapped_file_ );
+ if (options.size > static_cast<size_t>(std::numeric_limits<int>::max()))
+ return false;
+
// "name" is just a label in ashmem. It is visible in /proc/pid/maps.
mapped_file_ = ashmem_create_region(
options.name == NULL ? "" : options.name->c_str(),
« no previous file with comments | « base/shared_memory.h ('k') | base/shared_memory_nacl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698