Handle CNAME-only in ares_parse_aaaa_reply().
authorGuenter Knauf <lists@gknw.net>
Thu, 19 Apr 2012 17:27:02 +0000 (19:27 +0200)
committerGuenter Knauf <lists@gknw.net>
Thu, 19 Apr 2012 17:27:02 +0000 (19:27 +0200)
posted to the c-ares list by Peter Griess <pg@std.in>.

ares_parse_aaaa_reply.c

index 1fbe8389f74fd35f1fbf6a50d914246950bac8c7..b11df524952eb3b81e3ad48aab784497606aa96e 100644 (file)
@@ -204,7 +204,9 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
         }
     }
 
-  if (status == ARES_SUCCESS && naddrs == 0)
+  /* the check for naliases to be zero is to make sure CNAME responses
+     don't get caught here */
+  if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
     status = ARES_ENODATA;
   if (status == ARES_SUCCESS)
     {