From ffd7b275775c933547fec2dabf6bcf93160c6a11 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 29 Apr 2020 08:14:41 -0700 Subject: [PATCH] Fix c-ares resolver to properly handle error from SplitHostPort(). --- .../client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index 7e82c5b12a9..42df9af6c57 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -467,8 +467,7 @@ static bool inner_resolve_as_ip_literal_locked( const char* name, const char* default_port, std::unique_ptr* addrs, std::string* host, std::string* port, std::string* hostport) { - grpc_core::SplitHostPort(name, host, port); - if (host->empty()) { + if (!grpc_core::SplitHostPort(name, host, port)) { gpr_log(GPR_ERROR, "Failed to parse %s to host:port while attempting to resolve as ip " "literal.",