]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix ZoneName::operator< by traversing DNSName in the right direction.
authorMiod Vallat <miod.vallat@powerdns.com>
Thu, 26 Jun 2025 07:41:17 +0000 (09:41 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Thu, 26 Jun 2025 07:42:32 +0000 (09:42 +0200)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/dnsname.cc

index 31767710a0b4d688410de18e74dce438f9381e71..7ac2b77316f6d9e6e68008cf804afb864c0170c7 100644 (file)
@@ -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);