From 98a186e5af1e2eb92d46aac890de7c4dab8920ca Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 26 Jun 2025 09:41:17 +0200 Subject: [PATCH] Fix ZoneName::operator< by traversing DNSName in the right direction. Signed-off-by: Miod Vallat --- pdns/dnsname.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 31767710a0..7ac2b77316 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -926,10 +926,10 @@ bool ZoneName::operator<(const ZoneName& rhs) const // Order by DNSName first, by variant second. // Unfortunately we can't use std::lexicographical_compare_three_way() yet // as this would require C++20. - const auto *iter1 = d_name.getStorage().cbegin(); - const auto *last1 = d_name.getStorage().cend(); - const auto *iter2 = rhs.d_name.getStorage().cbegin(); - const auto *last2 = rhs.d_name.getStorage().cend(); + auto iter1 = d_name.getStorage().rbegin(); + const auto last1 = d_name.getStorage().rend(); + auto iter2 = rhs.d_name.getStorage().rbegin(); + const auto last2 = rhs.d_name.getStorage().rend(); while (iter1 != last1 && iter2 != last2) { auto char1 = dns_tolower(*iter1); auto char2 = dns_tolower(*iter2); -- 2.47.2