Changeset 5183


Ignore:
Timestamp:
Sep 29, 2015 8:38:42 AM (9 years ago)
Author:
nanang
Message:

Fix #1889: DNS parser should return error on RR class != IN only when RR type is known.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/dns.c

    r4712 r5183  
    327327 
    328328    /* Class MUST be IN */ 
    329     if (rr->dnsclass != 1) 
    330         return PJLIB_UTIL_EDNSINCLASS; 
     329    if (rr->dnsclass != 1) { 
     330        /* Class is not IN, return error only if type is known (see #1889) */ 
     331        if (rr->type == PJ_DNS_TYPE_A     || rr->type == PJ_DNS_TYPE_AAAA  || 
     332            rr->type == PJ_DNS_TYPE_CNAME || rr->type == PJ_DNS_TYPE_NS    || 
     333            rr->type == PJ_DNS_TYPE_PTR   || rr->type == PJ_DNS_TYPE_SRV) 
     334        { 
     335            return PJLIB_UTIL_EDNSINCLASS; 
     336        } 
     337    } 
    331338 
    332339    /* Get TTL */ 
Note: See TracChangeset for help on using the changeset viewer.