]> granicus.if.org Git - pdns/commitdiff
fix issue where nl.archive.ubuntu.org (and de) would not resolve. Thanks to Matti...
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 12 Mar 2008 19:42:56 +0000 (19:42 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 12 Mar 2008 19:42:56 +0000 (19:42 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1155 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/dnsparser.cc

index 5fc84ebb367364c42d0629e20c66109e2af31238..17372fee0b5b03bf46d4e0b46068676d93a0fe69 100644 (file)
@@ -472,7 +472,7 @@ string simpleCompress(const string& label, const string& root)
   string ret;
   ret.reserve(label.size()+4);
   for(parts_t::const_iterator i=parts.begin(); i!=parts.end(); ++i) {
-    if(!root.empty() && !strncasecmp(root.c_str(), label.c_str() + i->first, label.length() - i->first)) {
+    if(!root.empty() && !strncasecmp(root.c_str(), label.c_str() + i->first, 1 + label.length() - i->first)) { // also match trailing 0, hence '1 +'
       const char rootptr[2]={0xc0,0x11};
       ret.append(rootptr, 2);
       return ret;