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

Unified Diff: mojo/system/data_pipe_consumer_dispatcher.cc

Issue 304303006: Mojo: Specify/check alignment of pointers more carefully. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix msvs Created 6 years, 7 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 | « mojo/system/core_test_base.cc ('k') | mojo/system/data_pipe_producer_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/data_pipe_consumer_dispatcher.cc
diff --git a/mojo/system/data_pipe_consumer_dispatcher.cc b/mojo/system/data_pipe_consumer_dispatcher.cc
index 409db29ecc10cd2ac0dda5b369d0835116e8d955..2a2242c1b400373f6b196c9660d8615b0c3c46ed 100644
--- a/mojo/system/data_pipe_consumer_dispatcher.cc
+++ b/mojo/system/data_pipe_consumer_dispatcher.cc
@@ -56,7 +56,7 @@ MojoResult DataPipeConsumerDispatcher::ReadDataImplNoLock(
MojoReadDataFlags flags) {
lock().AssertAcquired();
- if (!VerifyUserPointer<uint32_t>(num_bytes, 1))
+ if (!VerifyUserPointer<uint32_t>(num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
if ((flags & MOJO_READ_DATA_FLAG_DISCARD)) {
@@ -75,7 +75,7 @@ MojoResult DataPipeConsumerDispatcher::ReadDataImplNoLock(
}
// Only verify |elements| if we're neither discarding nor querying.
- if (!VerifyUserPointer<void>(elements, *num_bytes))
+ if (!VerifyUserPointerWithSize<1>(elements, *num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
return data_pipe_->ConsumerReadData(
@@ -88,9 +88,9 @@ MojoResult DataPipeConsumerDispatcher::BeginReadDataImplNoLock(
MojoReadDataFlags flags) {
lock().AssertAcquired();
- if (!VerifyUserPointer<const void*>(buffer, 1))
+ if (!VerifyUserPointerWithCount<const void*>(buffer, 1))
return MOJO_RESULT_INVALID_ARGUMENT;
- if (!VerifyUserPointer<uint32_t>(buffer_num_bytes, 1))
+ if (!VerifyUserPointer<uint32_t>(buffer_num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
// These flags may not be used in two-phase mode.
if ((flags & MOJO_READ_DATA_FLAG_DISCARD) ||
« no previous file with comments | « mojo/system/core_test_base.cc ('k') | mojo/system/data_pipe_producer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698