Fix a segfault in client_lb_end2end_test (#29568)

In the SubchannelStreamClient constructor, do not initialize an
absl::string_view with a null pointer; this leads to strlen() being
called on the null pointer. Let the absl::string_view be initialized
with the string literal "SubchannelStreamClient" in this case instead.

Fixes #29567.
pull/29575/head
Ben Beasley 3 years ago committed by GitHub
parent ed5e26e3ae
commit a8cec7e58d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/core/ext/filters/client_channel/subchannel_stream_client.cc

@ -50,7 +50,8 @@ SubchannelStreamClient::SubchannelStreamClient(
call_allocator_(
ResourceQuotaFromChannelArgs(connected_subchannel_->args())
->memory_quota()
->CreateMemoryAllocator(tracer)),
->CreateMemoryAllocator(
(tracer != nullptr) ? tracer : "SubchannelStreamClient")),
event_handler_(std::move(event_handler)),
retry_backoff_(
BackOff::Options()

Loading…
Cancel
Save