From: phonedph1 Date: Tue, 4 Sep 2018 22:05:56 +0000 (+0000) Subject: Print possibly empty dnsnames safer X-Git-Tag: dnsdist-1.3.3~117^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3ca14b2ee0d1cfd66a64424dcfb9d03884c0ef0;p=thirdparty%2Fpdns.git Print possibly empty dnsnames safer --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 6ff2a84e01..e3f02a282a 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1250,7 +1250,7 @@ string doGenericTopQueries(pleasequeryfunc_t func, boost::functionfirst/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"; diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index 1b3a8c9908..a3eb224a35 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -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;