From: Miod Vallat Date: Fri, 6 Dec 2024 07:35:59 +0000 (+0100) Subject: Add unit test for invalid NSEC3 hex blob. X-Git-Tag: rec-5.2.0-rc1~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14913%2Fhead;p=thirdparty%2Fpdns.git Add unit test for invalid NSEC3 hex blob. --- diff --git a/pdns/test-dnsrecords_cc.cc b/pdns/test-dnsrecords_cc.cc index fb88f3407e..ddcd04271a 100644 --- a/pdns/test-dnsrecords_cc.cc +++ b/pdns/test-dnsrecords_cc.cc @@ -584,6 +584,9 @@ BOOST_AUTO_TEST_CASE(test_nsec_records_in) { BOOST_CHECK_THROW(MOADNSParser failParser(false, reinterpret_cast(packet.data()), packet.size()-1), MOADNSException); } + + // Invalid length of the NSEC3 hex blob + BOOST_CHECK_THROW(DNSRecordContent::make(QType::NSEC3PARAM, QClass::IN, "1 0 12 abcde"), RecordTextException); } BOOST_AUTO_TEST_CASE(test_nsec_records_types) {