]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add unit test for invalid NSEC3 hex blob. 14913/head
authorMiod Vallat <miod.vallat@open-xchange.com>
Fri, 6 Dec 2024 07:35:59 +0000 (08:35 +0100)
committerMiod Vallat <miod.vallat@open-xchange.com>
Fri, 6 Dec 2024 07:35:59 +0000 (08:35 +0100)
pdns/test-dnsrecords_cc.cc

index fb88f3407e288faee8c1b08a0eb1bae480a137c5..ddcd04271a2444a87ccb34d1ada8a11c1ef013bb 100644 (file)
@@ -584,6 +584,9 @@ BOOST_AUTO_TEST_CASE(test_nsec_records_in) {
 
     BOOST_CHECK_THROW(MOADNSParser failParser(false, reinterpret_cast<const char*>(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) {