jamesge commented on code in PR #2139:
URL: https://github.com/apache/brpc/pull/2139#discussion_r1119597368
##########
src/brpc/policy/domain_naming_service.cpp:
##########
@@ -96,7 +96,10 @@ int DomainNamingService::GetServers(const char* dns_name,
for(auto rp = addrResult; rp != NULL; rp = rp->ai_next) {
struct sockaddr_in6* a= (struct sockaddr_in6*)rp->ai_addr;
char straddr[INET6_ADDRSTRLEN + 2];
- inet_ntop(AF_INET6, &a->sin6_addr, straddr + 1, INET6_ADDRSTRLEN);
+ auto ret = inet_ntop(AF_INET6, &a->sin6_addr, straddr + 1,
INET6_ADDRSTRLEN);
+ if(ret == nullptr) {
+ continue;
Review Comment:
需要报错
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]