"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/ares_parse_soa_reply.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_soa_reply.c  (c-ares-1.17.1):ares_parse_soa_reply.c  (c-ares-1.17.2)
skipping to change at line 29 skipping to change at line 29
#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
#include "ares.h" #include "ares.h"
#include "ares_dns.h" #include "ares_dns.h"
#include "ares_data.h" #include "ares_data.h"
#include "ares_private.h" #include "ares_private.h"
int int
ares_parse_soa_reply(const unsigned char *abuf, int alen, ares_parse_soa_reply(const unsigned char *abuf, int alen,
struct ares_soa_reply **soa_out) struct ares_soa_reply **soa_out)
{ {
skipping to change at line 69 skipping to change at line 63
ancount = DNS_HEADER_ANCOUNT(abuf); ancount = DNS_HEADER_ANCOUNT(abuf);
if (qdcount != 1) if (qdcount != 1)
return ARES_EBADRESP; return ARES_EBADRESP;
if (ancount == 0) if (ancount == 0)
return ARES_EBADRESP; return ARES_EBADRESP;
aptr = abuf + HFIXEDSZ; aptr = abuf + HFIXEDSZ;
/* query name */ /* query name */
status = ares__expand_name_for_response(aptr, abuf, alen, &qname, &len); status = ares__expand_name_for_response(aptr, abuf, alen, &qname, &len, 0);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
goto failed_stat; goto failed_stat;
if (alen <= len + HFIXEDSZ + 1) if (alen <= len + HFIXEDSZ + 1)
goto failed; goto failed;
aptr += len; aptr += len;
qclass = DNS_QUESTION_TYPE(aptr); qclass = DNS_QUESTION_TYPE(aptr);
/* skip qtype & qclass */ /* skip qtype & qclass */
skipping to change at line 92 skipping to change at line 86
aptr += QFIXEDSZ; aptr += QFIXEDSZ;
/* qclass of SOA with multiple answers */ /* qclass of SOA with multiple answers */
if (qclass == T_SOA && ancount > 1) if (qclass == T_SOA && ancount > 1)
goto failed; goto failed;
/* examine all the records, break and return if found soa */ /* examine all the records, break and return if found soa */
for (i = 0; i < ancount; i++) for (i = 0; i < ancount; i++)
{ {
rr_name = NULL; rr_name = NULL;
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)
{ {
ares_free(rr_name); ares_free(rr_name);
goto failed_stat; goto failed_stat;
} }
aptr += len; aptr += len;
if ( aptr + RRFIXEDSZ > abuf + alen ) if ( aptr + RRFIXEDSZ > abuf + alen )
{ {
ares_free(rr_name); ares_free(rr_name);
skipping to change at line 129 skipping to change at line 123
soa = ares_malloc_data(ARES_DATATYPE_SOA_REPLY); soa = ares_malloc_data(ARES_DATATYPE_SOA_REPLY);
if (!soa) if (!soa)
{ {
ares_free(rr_name); ares_free(rr_name);
status = ARES_ENOMEM; status = ARES_ENOMEM;
goto failed_stat; goto failed_stat;
} }
/* nsname */ /* nsname */
status = ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname, status = ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname,
&len); &len, 0);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
{ {
ares_free(rr_name); ares_free(rr_name);
goto failed_stat; goto failed_stat;
} }
aptr += len; aptr += len;
/* hostmaster */ /* hostmaster */
status = ares__expand_name_for_response(aptr, abuf, alen, status = ares__expand_name_for_response(aptr, abuf, alen,
&soa->hostmaster, &len); &soa->hostmaster, &len, 0);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
{ {
ares_free(rr_name); ares_free(rr_name);
goto failed_stat; goto failed_stat;
} }
aptr += len; aptr += len;
/* integer fields */ /* integer fields */
if (aptr + 5 * 4 > abuf + alen) if (aptr + 5 * 4 > abuf + alen)
{ {
 End of changes. 5 change blocks. 
12 lines changed or deleted 6 lines changed or added

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