]> granicus.if.org Git - pdns/commitdiff
Recursor: Fix a possible crash
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 28 Jul 2016 12:21:10 +0000 (14:21 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 28 Jul 2016 12:21:10 +0000 (14:21 +0200)
When the parser creates empty DNSNames (for whatever reason) and
`rec_control current-queries` is run, the process would abort because it
tried to print an empty DNSName.

pdns/rec_channel_rec.cc

index a209e822a67aa4d99a8b23496ccf76c7f4726d2a..336f431251972a71bd9b2ada78ff19ead1adbc0b 100644 (file)
@@ -593,7 +593,7 @@ static string* pleaseGetCurrentQueries()
   for(MT_t::waiters_t::iterator mthread=MT->d_waiters.begin(); mthread!=MT->d_waiters.end() && n < 100; ++mthread, ++n) {
     const PacketID& pident = mthread->key;
     ostr << (fmt 
-             % pident.domain.toString() /* ?? */ % DNSRecordContent::NumberToType(pident.type) 
+             % pident.domain.toLogString() /* ?? */ % DNSRecordContent::NumberToType(pident.type) 
              % pident.remote.toString() % (pident.sock ? 'Y' : 'n')
              % (pident.fd == -1 ? 'Y' : 'n')
              );