From 32b75d1b6995653a4f1131aaa7e4c23b9946047e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 11 Jan 2009 13:49:13 +0000 Subject: - Phil Blundell added the internal function ares__expand_name_for_response() that is now used by the ares_parse_*_reply() functions instead of the ares_expand_name() simply to easier return ARES_EBADRESP for the cases where the name expansion fails as in responses that really isn't expected. --- ares/ares_parse_aaaa_reply.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ares/ares_parse_aaaa_reply.c') diff --git a/ares/ares_parse_aaaa_reply.c b/ares/ares_parse_aaaa_reply.c index 6a43f933c..60f8f851b 100644 --- a/ares/ares_parse_aaaa_reply.c +++ b/ares/ares_parse_aaaa_reply.c @@ -84,7 +84,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; - status = ares_expand_name(aptr, abuf, alen, &hostname, &len); + status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) @@ -123,7 +123,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, for (i = 0; i < (int)ancount; i++) { /* Decode the RR up to the data field. */ - status = ares_expand_name(aptr, abuf, alen, &rr_name, &len); + status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) break; aptr += len; @@ -176,7 +176,8 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, naliases++; /* Decode the RR data and replace the hostname with it. */ - status = ares_expand_name(aptr, abuf, alen, &rr_data, &len); + status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data, + &len); if (status != ARES_SUCCESS) break; free(hostname); -- cgit v1.2.3