]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Print possibly empty dnsnames safer
authorphonedph1 <phoned@gmail.com>
Tue, 4 Sep 2018 22:05:56 +0000 (22:05 +0000)
committerphonedph1 <phoned@gmail.com>
Tue, 4 Sep 2018 22:05:56 +0000 (22:05 +0000)
pdns/rec_channel_rec.cc
pdns/ws-recursor.cc

index 6ff2a84e015e98016e0e1f9e7dbdd1c6952f23a7..e3f02a282ad412f78bc01ff2cb3bf5d0644d915b 100644 (file)
@@ -1250,7 +1250,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 1b3a8c990840b1befdc9ba1f6dcb6b25868618cd..a3eb224a35e49558f6b5d009f8b9e8c43775a0b8 100644 (file)
@@ -517,7 +517,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;