ares_search() and ares_getaddrinfo() resolution fails if no search domains

Due to an error in creating the list of domains to search, if no search
domains were configured, resolution would fail.

Fixes Issue: #737
Fix By: Brad House (@bradh352)
pull/739/head
Brad House 10 months ago
parent 4be451c433
commit b00b0acd05
  1. 4
      src/lib/ares_search.c

@ -243,6 +243,10 @@ ares_status_t ares__search_name_list(const ares_channel_t *channel,
goto done; goto done;
} }
/* Set status here, its possible there are no search domains at all, so
* status may be ARES_ENOTFOUND from ares__lookup_hostaliases(). */
status = ARES_SUCCESS;
/* Try as-is first */ /* Try as-is first */
if (ndots >= channel->ndots) { if (ndots >= channel->ndots) {
list[idx] = ares_strdup(name); list[idx] = ares_strdup(name);

Loading…
Cancel
Save