From: Remi Gacogne Date: Mon, 20 Apr 2026 09:09:49 +0000 (+0200) Subject: rec: Use `DNSName::trimToLabels` as suggested by Miod (thanks!) X-Git-Tag: auth-5.1.0-beta1~36^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f2176b478bc50148b3ba245dffdfed8b06b47b8;p=thirdparty%2Fpdns.git rec: Use `DNSName::trimToLabels` as suggested by Miod (thanks!) Signed-off-by: Remi Gacogne --- diff --git a/pdns/validate.cc b/pdns/validate.cc index 6af443acc1..aec3b425d9 100644 --- a/pdns/validate.cc +++ b/pdns/validate.cc @@ -581,10 +581,7 @@ dState getDenial(const cspmap_t& validrrsets, const DNSName& qname, const uint16 and can prevent the wildcard from applying. */ nameToDeny = qname; - const auto chopCount = nameToDeny.countLabels() - wildcardLabelsCount - 1; - for (size_t idx = 0; idx < chopCount; ++idx) { - nameToDeny.chopOff(); - } + nameToDeny.trimToLabels(wildcardLabelsCount + 1); } else { nameToDeny = qname;