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.
This commit is contained in:
Ben Beasley 2022-05-04 13:13:28 -04:00 committed by GitHub
parent ed5e26e3ae
commit a8cec7e58d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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()