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

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

Issue 328183002: More clear comment for ValidateStructHeader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/public/cpp/bindings/lib/bindings_serialization.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/bindings_serialization.cc
diff --git a/mojo/public/cpp/bindings/lib/bindings_serialization.cc b/mojo/public/cpp/bindings/lib/bindings_serialization.cc
index d341b21446cd5154caf7a3813988c5091540be99..d5f778536847173015d3326b625750bacf72e29b 100644
--- a/mojo/public/cpp/bindings/lib/bindings_serialization.cc
+++ b/mojo/public/cpp/bindings/lib/bindings_serialization.cc
@@ -84,6 +84,8 @@ bool ValidateStructHeader(const void* data,
uint32_t min_num_bytes,
uint32_t min_num_fields,
BoundsChecker* bounds_checker) {
+ assert(min_num_bytes >= sizeof(StructHeader));
+
if (!IsAligned(data)) {
ReportValidationError(VALIDATION_ERROR_MISALIGNED_OBJECT);
return false;
« no previous file with comments | « mojo/public/cpp/bindings/lib/bindings_serialization.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698