diff options
author | Julien Boeuf <jboeuf@google.com> | 2017-01-19 21:29:00 -0800 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2017-01-19 21:29:00 -0800 |
commit | f575369d054c358543ccc431d3ad84d83fc2114d (patch) | |
tree | d783b20fcda5f1fae031532ad35307b613d28d1f /test/core/handshake | |
parent | fffb692d37867f040b2b7bb2e982d5137dfb123e (diff) |
Fixing msan issue in client_ssl.c
See this error (somehow triggered by a new version of boringssl):
https://grpc-testing.appspot.com/job/gRPC_pull_requests_msan_c/1154/testReport/junit/(root)/c_linux_msan/bins_msan_handshake_client_GRPC_POLL_STRATEGY_poll_cv/
In the alpn callback, in_len is the size of the in buffer and not the number of alpn elements.
Diffstat (limited to 'test/core/handshake')
-rw-r--r-- | test/core/handshake/client_ssl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/core/handshake/client_ssl.c b/test/core/handshake/client_ssl.c index 24281e0b41..613251b835 100644 --- a/test/core/handshake/client_ssl.c +++ b/test/core/handshake/client_ssl.c @@ -104,7 +104,8 @@ static int alpn_select_cb(SSL *ssl, const uint8_t **out, uint8_t *out_len, bool grpc_exp_seen = false; bool h2_seen = false; const char *inp = (const char *)in; - for (int i = 0; i < (int)in_len; ++i) { + const char *in_end = inp + in_len; + while (inp < in_end) { const size_t length = (size_t)*inp++; if (length == strlen("grpc-exp") && strncmp(inp, "grpc-exp", length) == 0) { grpc_exp_seen = true; @@ -117,6 +118,7 @@ static int alpn_select_cb(SSL *ssl, const uint8_t **out, uint8_t *out_len, inp += length; } + GPR_ASSERT(inp == in_end); GPR_ASSERT(grpc_exp_seen); GPR_ASSERT(h2_seen); |