]> granicus.if.org Git - pdns/commitdiff
escaping unusual DNS label octets in DNSName is off by one
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 28 Nov 2017 20:42:22 +0000 (21:42 +0100)
committermind04 <mind04@monshouwer.org>
Tue, 28 Nov 2017 20:52:41 +0000 (21:52 +0100)
https://tools.ietf.org/html/rfc4343#section-2.1

pdns/dnsname.cc

index c9dee777048ce09c761fdbd59706373d5e34b9cd..ecfda97bec5015ae82db6fdcf247afa740f16d1b 100644 (file)
@@ -423,7 +423,7 @@ string DNSName::escapeLabel(const std::string& label)
       ret+="\\.";
     else if(p=='\\')
       ret+="\\\\";
-    else if(p > 0x21 && p < 0x7e)
+    else if(p > 0x20 && p < 0x7f)
       ret.append(1, (char)p);
     else {
       ret+="\\" + (boost::format("%03d") % (unsigned int)p).str();