]> granicus.if.org Git - pdns/commitdiff
Print possibly empty dnsnames safer
authorphonedph1 <phoned@gmail.com>
Tue, 4 Sep 2018 22:05:56 +0000 (22:05 +0000)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 31 Oct 2018 15:04:51 +0000 (16:04 +0100)
(cherry picked from commit d3ca14b2ee0d1cfd66a64424dcfb9d03884c0ef0)

pdns/rec_channel_rec.cc
pdns/ws-recursor.cc

index 177b0863a497073b1c25ce5116b18997fab69e5d..cbbee2e37d9e080785f309f1365921ba5264e884 100644 (file)
@@ -1186,7 +1186,7 @@ string doGenericTopQueries(pleasequeryfunc_t func, boost::function<DNSName(const
   int limit=0, accounted=0;
   if(total) {
     for(rcounts_t::const_iterator i=rcounts.begin(); i != rcounts.end() && limit < 20; ++i, ++limit) {
-      ret<< fmt % (-100.0*i->first/total) % (i->second.first.toString()+"|"+DNSRecordContent::NumberToType(i->second.second));
+      ret<< fmt % (-100.0*i->first/total) % (i->second.first.toLogString()+"|"+DNSRecordContent::NumberToType(i->second.second));
       accounted+= -i->first;
     }
     ret<< '\n' << fmt % (100.0*(total-accounted)/total) % "rest";
index dbe1c07d38e9bcd67af5b36b2a5fe8a85585a03e..0f71ee4f0b33c2f7b379a7302d320a38d19bf9f2 100644 (file)
@@ -515,7 +515,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse *resp)
     for(const rcounts_t::value_type& q :  rcounts) {
       totIncluded-=q.first;
       entries.push_back(Json::array {
-        -q.first, q.second.first.toString(), DNSRecordContent::NumberToType(q.second.second)
+        -q.first, q.second.first.toLogString(), DNSRecordContent::NumberToType(q.second.second)
       });
       if(tot++>=100)
        break;