Skip to content

Commit

Permalink
ares_parse_a_reply: fix CNAME response parsing
Browse files Browse the repository at this point in the history
Reply to a CNAME query doesn't contain addresses, causing
ares_parse_a_reply() to bail out with ARES_ENODATA

Bug: http://groups.google.com/group/nodejs/browse_thread/thread/a1268c9ea5e9ad9b
  • Loading branch information
bnoordhuis authored and bagder committed Dec 2, 2010
1 parent 41b8a1b commit 2c63440
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ares_parse_a_reply.c
Expand Up @@ -201,7 +201,9 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
}
}

if (status == ARES_SUCCESS && naddrs == 0)
if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
/* the check for naliases to be zero is to make sure CNAME responses
don't get caught here */
status = ARES_ENODATA;
if (status == ARES_SUCCESS)
{
Expand Down

0 comments on commit 2c63440

Please sign in to comment.