From: Bert Hubert Date: Sat, 22 Mar 2008 16:03:15 +0000 (+0000) Subject: properly convey empty TXT strings (why??) through the recursor, closing ticket 178 X-Git-Tag: rec-3.1.7.1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=950f78df749100ef815da1a67f5619a144c6cd2c;p=thirdparty%2Fpdns.git properly convey empty TXT strings (why??) through the recursor, closing ticket 178 git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1166 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index 17372fee0b..00c4f22fce 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -400,9 +400,10 @@ string PacketReader::getText(bool multi) unsigned char labellen=d_content.at(d_pos++); ret.append(1,'"'); - string val(&d_content.at(d_pos), &d_content.at(d_pos+labellen-1)+1); - - ret.append(txtEscape(val)); // the end is one beyond the packet + if(labellen) { // no need to do anything for an empty string + string val(&d_content.at(d_pos), &d_content.at(d_pos+labellen-1)+1); + ret.append(txtEscape(val)); // the end is one beyond the packet + } ret.append(1,'"'); d_pos+=labellen; if(!multi)