From: Vladimír Čunát Date: Thu, 28 Apr 2022 10:37:31 +0000 (+0200) Subject: lib/dnssec: nits X-Git-Tag: v5.5.1~13^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ece2cab78a60083acf975f173dae1590aff047c;p=thirdparty%2Fknot-resolver.git lib/dnssec: nits --- diff --git a/lib/dnssec/nsec.c b/lib/dnssec/nsec.c index b71fdd36b..7eaeedbe2 100644 --- a/lib/dnssec/nsec.c +++ b/lib/dnssec/nsec.c @@ -300,16 +300,13 @@ int kr_nsec_matches_name_and_type(const knot_rrset_t *nsec, const knot_dname_t *name, uint16_t type) { /* It's not secure enough to just check a single bit for (some) other types, - * but we don't (currently) only use this API for NS. See RFC 6840 sec. 4. - */ - if (kr_fails_assert(type == KNOT_RRTYPE_NS && nsec && name)) + * but we (currently) only use this API for NS. See RFC 6840 sec. 4. */ + if (kr_fails_assert(type == KNOT_RRTYPE_NS && nsec && nsec->rrs.rdata && name)) return kr_error(EINVAL); if (!knot_dname_is_equal(nsec->owner, name)) return kr_error(ENOENT); const uint8_t *bm = knot_nsec_bitmap(nsec->rrs.rdata); uint16_t bm_size = knot_nsec_bitmap_len(nsec->rrs.rdata); - if (!bm) - return kr_error(EINVAL); if (dnssec_nsec_bitmap_contains(bm, bm_size, type)) { return kr_ok(); } else {