diff --git a/ares/ares_gethostbyname.c b/ares/ares_gethostbyname.c index 8610cba632694cc9d6a9cb993de58e5ca1d29cce..7c39ad12003a2a68018d2a69c696b8cadbb843d8 100644 --- a/ares/ares_gethostbyname.c +++ b/ares/ares_gethostbyname.c @@ -138,7 +138,11 @@ static void next_lookup(struct host_query *hquery, int status_code) case 'f': /* Host file lookup */ status = file_lookup(hquery->name, hquery->family, &host); - if (status != ARES_ENOTFOUND) + + /* this status check below previously checked for !ARES_ENOTFOUND, + but we should not assume that this single error code is the one + that can occur, as that is in fact no longer the case */ + if (status == ARES_SUCCESS) { end_hquery(hquery, status, host); return;