From: bert hubert Date: Mon, 18 Aug 2014 14:35:56 +0000 (+0200) Subject: make sure we don't encode the root label in EDNS0 for root queries as c00c, upsets... X-Git-Tag: auth-3.4.0-rc2~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b44e420d38a86c2607d0606b8f73f0a5ae78731;p=pdns make sure we don't encode the root label in EDNS0 for root queries as c00c, upsets auth servers - reported by jens link --- diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index 594e616ce..8984e50be 100644 --- a/pdns/dnswriter.cc +++ b/pdns/dnswriter.cc @@ -68,7 +68,7 @@ void DNSPacketWriter::startRecord(const string& name, uint16_t qtype, uint32_t t d_stuff = 0; d_rollbackmarker=d_content.size(); - if(compress && pdns_iequals(d_qname, d_recordqname)) { // don't do the whole label compression thing if we *know* we can get away with "see question" + if(compress && !d_recordqname.empty() && pdns_iequals(d_qname, d_recordqname)) { // don't do the whole label compression thing if we *know* we can get away with "see question" - except when compressing the root static unsigned char marker[2]={0xc0, 0x0c}; d_content.insert(d_content.end(), (const char *) &marker[0], (const char *) &marker[2]); }