Skip to content

Commit 950c734

Browse files
committed
DNS timeout: validate that c-Ares returns a success code
we weren't checking the status returned from c-ares in cases such as timeouts This is to prevent pushing an empty array list in the event that a DNS timeout occurs
1 parent 6545076 commit 950c734

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/common/network/dns_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void DnsResolverImpl::PendingResolution::onAresGetAddrInfoCallback(int status, i
127127
}
128128

129129
if (completed_) {
130-
if (!cancelled_) {
130+
if (!cancelled_ && status == ARES_SUCCESS) {
131131
try {
132132
callback_(std::move(address_list));
133133
} catch (const EnvoyException& e) {

0 commit comments

Comments
 (0)