From: Kees Monshouwer Date: Tue, 28 Nov 2017 20:42:22 +0000 (+0100) Subject: escaping unusual DNS label octets in DNSName is off by one X-Git-Tag: dnsdist-1.3.0~161^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=568556f8efca322a92a87b4bdc03c6af1a75a8f6;p=pdns escaping unusual DNS label octets in DNSName is off by one https://tools.ietf.org/html/rfc4343#section-2.1 --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index c9dee7770..ecfda97be 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -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();