| Index: mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| diff --git a/mojo/public/cpp/bindings/tests/validation_unittest.cc b/mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| index 7b7dcbeee2fe835194379387a7784bfb02dfa185..1d3185dd6a93908eef26ff05716129ba283cab46 100644
|
| --- a/mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| +++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| @@ -424,6 +424,18 @@ TEST_F(ValidationTest, ResponseBoundsCheck) {
|
| RunValidationTests("resp_boundscheck_", &validators);
|
| }
|
|
|
| +// Test that the client cannot send a message (e.g. a recursively defined
|
| +// struct) so deep that the validation code blows the stack. The validation code
|
| +// should check for this case and return a validation error.
|
| +TEST_F(ValidationTest, RequestMaxRecursionDepth) {
|
| + DummyMessageReceiver dummy_receiver;
|
| + mojo::FilterChain validators(&dummy_receiver);
|
| + validators.Append<mojo::MessageHeaderValidator>();
|
| + validators.Append<RecursionDepthTestInterface::RequestValidator_>();
|
| +
|
| + RunValidationTests("req_max_recursion_depth", &validators);
|
| +}
|
| +
|
| // Test that InterfacePtr<X> applies the correct validators and they don't
|
| // conflict with each other:
|
| // - MessageHeaderValidator
|
|
|