]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
do a better job at escaping TXT, fixes #795
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 13 May 2013 06:45:17 +0000 (08:45 +0200)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 13 May 2013 08:04:48 +0000 (10:04 +0200)
pdns/dnsparser.cc

index a1e1315f7aff16dde4243f45b98c92e42aa52649..7889aa95993602ac6347e2525c6ae4ab1942e828 100644 (file)
@@ -392,10 +392,7 @@ static string txtEscape(const string &name)
   char ebuf[5];
 
   for(string::const_iterator i=name.begin();i!=name.end();++i) {
-    if(*i=='\n') {  // XXX FIXME this should do a way better job!
-      ret += "\\010";
-    }
-    else if((unsigned char) *i > 127) {
+    if((unsigned char) *i > 127 || (unsigned char) *i < 32) {
       snprintf(ebuf, sizeof(ebuf), "\\%03u", (unsigned char)*i);
       ret += ebuf;
     }