diff --git a/src/dnssec.c b/src/dnssec.c index b46be44b..f567b96b 100644 --- a/src/dnssec.c +++ b/src/dnssec.c @@ -2049,7 +2049,8 @@ static int find_nsec_covering_name( , SECTION_NO_ADDITIONAL) ; i ; i = _getdns_rrset_iter_next(i)) { - if ((n = _getdns_rrset_iter_value(i))->rr_type == GETDNS_RRTYPE_NSEC3 + if ((n = _getdns_rrset_iter_value(i)) + && n->rr_type == GETDNS_RRTYPE_NSEC3 /* Get the bitmap rdata field */ && (nsec_rr = _getdns_rrtype_iter_init(&nsec_spc, n)) @@ -2085,7 +2086,8 @@ static int find_nsec_covering_name( return keytag; } - if ((n = _getdns_rrset_iter_value(i))->rr_type == GETDNS_RRTYPE_NSEC + if ((n = _getdns_rrset_iter_value(i)) + && n->rr_type == GETDNS_RRTYPE_NSEC && nsec_covers_name(n, name, NULL) /* Get the bitmap rdata field */ diff --git a/src/rr-iter.c b/src/rr-iter.c index e6a711de..9b332603 100644 --- a/src/rr-iter.c +++ b/src/rr-iter.c @@ -306,7 +306,7 @@ static int rr_owner_equal(_getdns_rr_iter *rr, const uint8_t *name) return (owner = _getdns_owner_if_or_as_decompressed(rr, owner_spc ,&owner_len)) - && _getdns_dname_equal(owner, name); + && name && _getdns_dname_equal(owner, name); } /* First a few filter functions that filter a RR iterator to point only