From 568556f8efca322a92a87b4bdc03c6af1a75a8f6 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Tue, 28 Nov 2017 21:42:22 +0100 Subject: [PATCH] escaping unusual DNS label octets in DNSName is off by one https://tools.ietf.org/html/rfc4343#section-2.1 --- pdns/dnsname.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index c9dee77704..ecfda97bec 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(); -- 2.39.5