2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Add additional contraints to dns_rdata_checksvcb

REQUIRE that rdata->type is dns_rdatatype_svcb to detect when
dns_rdata_checksvcb is called with the wrong rdata type.  There are
no code paths that currently pass the wrong rdata to dns_rdata_checksvcb.

This was found by GCC 12 static analysis.
This commit is contained in:
Mark Andrews
2023-03-08 16:38:11 +11:00
parent f0c8da6d31
commit e37c9702ae
2 changed files with 2 additions and 1 deletions

View File

@@ -2435,6 +2435,7 @@ dns_rdata_checksvcb(const dns_name_t *owner, const dns_rdata_t *rdata) {
REQUIRE(owner != NULL);
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_svcb);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata));
result = dns_rdata_tostruct(rdata, &svcb, NULL);