diff options
Diffstat (limited to 'deps/cares/src/ares_search.c')
-rw-r--r-- | deps/cares/src/ares_search.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/deps/cares/src/ares_search.c b/deps/cares/src/ares_search.c index ec076405ad..f9558a9a50 100644 --- a/deps/cares/src/ares_search.c +++ b/deps/cares/src/ares_search.c @@ -239,7 +239,7 @@ static int single_domain(ares_channel channel, const char *name, char **s) /* If the name contains a trailing dot, then the single query is the name * sans the trailing dot. */ - if (name[len - 1] == '.') + if ((len > 0) && (name[len - 1] == '.')) { *s = strdup(name); return (*s) ? ARES_SUCCESS : ARES_ENOMEM; |