"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/ares__parse_into_addrinfo.c" between
c-ares-1.17.1.tar.gz and c-ares-1.17.2.tar.gz

About: c-ares is a C library for asynchronous DNS requests (including name resolves).

ares__parse_into_addrinfo.c  (c-ares-1.17.1):ares__parse_into_addrinfo.c  (c-ares-1.17.2)
skipping to change at line 27 skipping to change at line 27
#ifdef HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H
# include <netinet/in.h> # include <netinet/in.h>
#endif #endif
#ifdef HAVE_NETDB_H #ifdef HAVE_NETDB_H
# include <netdb.h> # include <netdb.h>
#endif #endif
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h> # include <arpa/inet.h>
#endif #endif
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h> #include "ares_nameser.h"
#else
# include "nameser.h"
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
# include <arpa/nameser_compat.h>
#endif
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif #endif
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
# include <limits.h> # include <limits.h>
#endif #endif
#include "ares.h" #include "ares.h"
skipping to change at line 78 skipping to change at line 72
return ARES_EBADRESP; return ARES_EBADRESP;
/* Fetch the question and answer count from the header. */ /* Fetch the question and answer count from the header. */
qdcount = DNS_HEADER_QDCOUNT(abuf); qdcount = DNS_HEADER_QDCOUNT(abuf);
ancount = DNS_HEADER_ANCOUNT(abuf); ancount = DNS_HEADER_ANCOUNT(abuf);
if (qdcount != 1) if (qdcount != 1)
return ARES_EBADRESP; return ARES_EBADRESP;
/* Expand the name from the question, and skip past the question. */ /* Expand the name from the question, and skip past the question. */
aptr = abuf + HFIXEDSZ; aptr = abuf + HFIXEDSZ;
status = ares__expand_name_for_response(aptr, abuf, alen, question_hostname, & len); status = ares__expand_name_for_response(aptr, abuf, alen, question_hostname, & len, 0);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return status; return status;
if (aptr + len + QFIXEDSZ > abuf + alen) if (aptr + len + QFIXEDSZ > abuf + alen)
{ {
return ARES_EBADRESP; return ARES_EBADRESP;
} }
hostname = *question_hostname; hostname = *question_hostname;
aptr += len + QFIXEDSZ; aptr += len + QFIXEDSZ;
/* Examine each answer resource record (RR) in turn. */ /* Examine each answer resource record (RR) in turn. */
for (i = 0; i < (int)ancount; i++) for (i = 0; i < (int)ancount; i++)
{ {
/* Decode the RR up to the data field. */ /* Decode the RR up to the data field. */
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len); status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len, 0);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
{ {
rr_name = NULL; rr_name = NULL;
goto failed_stat; goto failed_stat;
} }
aptr += len; aptr += len;
if (aptr + RRFIXEDSZ > abuf + alen) if (aptr + RRFIXEDSZ > abuf + alen)
{ {
status = ARES_EBADRESP; status = ARES_EBADRESP;
skipping to change at line 196 skipping to change at line 190
node->ai_ttl = rr_ttl; node->ai_ttl = rr_ttl;
status = ARES_SUCCESS; status = ARES_SUCCESS;
} }
if (rr_class == C_IN && rr_type == T_CNAME) if (rr_class == C_IN && rr_type == T_CNAME)
{ {
got_cname = 1; got_cname = 1;
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data, status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
&len); &len, 1);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
{ {
goto failed_stat; goto failed_stat;
} }
/* Decode the RR data and replace the hostname with it. */ /* Decode the RR data and replace the hostname with it. */
/* SA: Seems wrong as it introduses order dependency. */ /* SA: Seems wrong as it introduses order dependency. */
hostname = rr_data; hostname = rr_data;
cname = ares__append_addrinfo_cname(&cnames); cname = ares__append_addrinfo_cname(&cnames);
 End of changes. 4 change blocks. 
11 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)