diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2015-09-29 08:38:42 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2015-09-29 08:38:42 +0000 |
commit | 068a9a1f341d0363730403422a7a300da7c7a5b1 (patch) | |
tree | 558b84b16ee51d3f01b506b0cc5c90b72446a42c /pjlib-util | |
parent | 6a9c496c75a57ee4cf4e8650000cdbad40bd5021 (diff) |
Fix #1889: DNS parser should return error on RR class != IN only when RR type is known.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5183 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib-util')
-rw-r--r-- | pjlib-util/src/pjlib-util/dns.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pjlib-util/src/pjlib-util/dns.c b/pjlib-util/src/pjlib-util/dns.c index 09d518ed..dccb8f0c 100644 --- a/pjlib-util/src/pjlib-util/dns.c +++ b/pjlib-util/src/pjlib-util/dns.c @@ -326,8 +326,15 @@ static pj_status_t parse_rr(pj_dns_parsed_rr *rr, pj_pool_t *pool, p += 2; /* Class MUST be IN */ - if (rr->dnsclass != 1) - return PJLIB_UTIL_EDNSINCLASS; + if (rr->dnsclass != 1) { + /* Class is not IN, return error only if type is known (see #1889) */ + if (rr->type == PJ_DNS_TYPE_A || rr->type == PJ_DNS_TYPE_AAAA || + rr->type == PJ_DNS_TYPE_CNAME || rr->type == PJ_DNS_TYPE_NS || + rr->type == PJ_DNS_TYPE_PTR || rr->type == PJ_DNS_TYPE_SRV) + { + return PJLIB_UTIL_EDNSINCLASS; + } + } /* Get TTL */ pj_memcpy(&rr->ttl, p, 4); |