From 7b622ab558882a984b597cd87fe7175f5e1eea23 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 10 May 2017 07:58:41 -0700 Subject: ubsan fix: dont deref past end of array --- test/cpp/microbenchmarks/bm_call_create.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/cpp/microbenchmarks') diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index c91219e98c..67e7c02535 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -563,7 +563,8 @@ static void BM_IsolatedFilter(benchmark::State &state) { } grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - size_t channel_size = grpc_channel_stack_size(&filters[0], filters.size()); + size_t channel_size = grpc_channel_stack_size( + filters.size() == 0 ? NULL : &filters[0], filters.size()); grpc_channel_stack *channel_stack = static_cast(gpr_zalloc(channel_size)); GPR_ASSERT(GRPC_LOG_IF_ERROR( -- cgit v1.2.3