From: Miod Vallat Date: Mon, 13 Jul 2026 08:45:06 +0000 (+0200) Subject: Replace the use of strncasecmp with pdns_ilexicographical_compare_three_way. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9879b8c751d85379e59a4d32e1d707a1c4f04662;p=thirdparty%2Fpdns.git Replace the use of strncasecmp with pdns_ilexicographical_compare_three_way. Signed-off-by: Miod Vallat --- diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index da0ea55682..05c044dc76 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -786,7 +786,8 @@ string simpleCompress(const string& elabel, const string& root) string ret; ret.reserve(label.size()+4); for(const auto & part : parts) { - if(!root.empty() && !strncasecmp(root.c_str(), label.c_str() + part.first, 1 + label.length() - part.first)) { // also match trailing 0, hence '1 +' + auto label_part = std::string_view(label.c_str() + part.first, 1 + label.length() - part.first); // also match trailing 0, hence '1 +' + if(!root.empty() && pdns_ilexicographical_compare_three_way(root, label_part) == 0) { const unsigned char rootptr[2]={0xc0,0x11}; ret.append((const char *) rootptr, 2); return ret;