From 4936b143981d69985a78c7981ce04c9b73073044 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Fri, 6 Dec 2024 08:35:59 +0100 Subject: [PATCH] Add unit test for invalid NSEC3 hex blob. --- pdns/test-dnsrecords_cc.cc | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.47.2