From: Peter van Dijk Date: Mon, 18 May 2015 09:01:26 +0000 (+0200) Subject: yolo X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~58^2~21^2~5^2~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f3151e800e65654c491c6d538a5bfe7c42164c9;p=thirdparty%2Fpdns.git yolo --- diff --git a/pdns/dnslabeltext.rl b/pdns/dnslabeltext.rl index fe44865f22..ce3f0ecc7f 100644 --- a/pdns/dnslabeltext.rl +++ b/pdns/dnslabeltext.rl @@ -19,6 +19,7 @@ void appendSplit(vector& ret, string& segment, char c) vector segmentDNSText(const string& input ) { + cerr<<"segmentDNSText("< segmentDNSText(const string& input ) deque segmentDNSName(const string& input ) { + cerr<<"segmentDNSName("< segmentDNSName(const string& input ) }%% (void)dnsname_error; // silence warnings (void)dnsname_en_main; - const char *p = input.c_str(), *pe = input.c_str() + input.length(); + + deque ret; + + string realinput; + if(input.empty() || input == ".") return ret; + + if(input[input.size()-1]!='.') realinput=input+"."; // FIXME YOLO + else realinput=input; + + const char *p = realinput.c_str(), *pe = realinput.c_str() + realinput.length(); const char* eof = pe; int cs; char val = 0; string label; - deque ret; %%{ action labelEnd { @@ -137,7 +147,7 @@ deque segmentDNSName(const string& input ) }%% if ( cs < dnsname_first_final ) { - throw runtime_error("Unable to parse DNS name '"+input+"': cs="+std::to_string(cs)); + throw runtime_error("Unable to parse DNS name '"+input+"' ('"+realinput+"'): cs="+std::to_string(cs)); } return ret;