Skip to content

Commit

Permalink
DNS timeout: validate that c-Ares returns a success code
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chrisgoffinet committed Feb 4, 2020
1 parent 6545076 commit 950c734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/common/network/dns_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void DnsResolverImpl::PendingResolution::onAresGetAddrInfoCallback(int status, i
}

if (completed_) {
if (!cancelled_) {
if (!cancelled_ && status == ARES_SUCCESS) {
try {
callback_(std::move(address_list));
} catch (const EnvoyException& e) {
Expand Down

0 comments on commit 950c734

Please sign in to comment.