From 7d0836c2b84697e1b452f2b2970479f9174f6c9d Mon Sep 17 00:00:00 2001 From: Greg Hazel Date: Sun, 14 Aug 2022 14:02:48 -0700 Subject: [PATCH] handle empty answers as EAI_ADDRFAMILY Signed-off-by: Kirill Rodriguez --- evdns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/evdns.c b/evdns.c index 9fabc08c..469f63b6 100644 --- a/evdns.c +++ b/evdns.c @@ -5698,8 +5698,9 @@ evdns_getaddrinfo_fromhosts(struct evdns_base *base, EVDNS_UNLOCK(base); out: if (n_found) { - /* Note that we return an empty answer if we found entries for - * this hostname but none were of the right address type. */ + if (!ai) { + return EVUTIL_EAI_ADDRFAMILY; + } *res = ai; return 0; } else {