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

Unified Diff: mojo/public/cpp/bindings/tests/union_unittest.cc

Issue 2036623002: Validate map keys in C++ Mojo bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 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
Index: mojo/public/cpp/bindings/tests/union_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/union_unittest.cc b/mojo/public/cpp/bindings/tests/union_unittest.cc
index 2c6c461a68bcb22ab020b18365d0e331b8b2dd37..a5f65af52fa8ed066b24b0f7d6c0e762f5319c8a 100644
--- a/mojo/public/cpp/bindings/tests/union_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/union_unittest.cc
@@ -705,7 +705,9 @@ TEST(UnionTest, PodUnionInMapSerialization) {
mojo::internal::FixedBufferForTesting buf(size);
mojo::internal::Map_Data<mojo::internal::String_Data*,
internal::PodUnion_Data>* data;
- mojo::internal::ArrayValidateParams validate_params(0, false, nullptr);
+ mojo::internal::ArrayValidateParams validate_params(
+ new mojo::internal::ArrayValidateParams(0, false, nullptr),
+ new mojo::internal::ArrayValidateParams(0, false, nullptr));
mojo::internal::Serialize<Map<String, PodUnionPtr>>(
map, &buf, &data, &validate_params, &context);
@@ -731,7 +733,9 @@ TEST(UnionTest, PodUnionInMapSerializationWithNull) {
mojo::internal::FixedBufferForTesting buf(size);
mojo::internal::Map_Data<mojo::internal::String_Data*,
internal::PodUnion_Data>* data;
- mojo::internal::ArrayValidateParams validate_params(0, true, nullptr);
+ mojo::internal::ArrayValidateParams validate_params(
+ new mojo::internal::ArrayValidateParams(0, false, nullptr),
+ new mojo::internal::ArrayValidateParams(0, true, nullptr));
mojo::internal::Serialize<Map<String, PodUnionPtr>>(
map, &buf, &data, &validate_params, &context);

Powered by Google App Engine
This is Rietveld 408576698