From: phonedph1 Date: Tue, 4 Sep 2018 22:05:56 +0000 (+0000) Subject: Print possibly empty dnsnames safer X-Git-Tag: rec-4.1.5~1^2~3^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=270a68fa948ae2abeacdeb4cde82ee0c8e73b6ef;p=pdns Print possibly empty dnsnames safer (cherry picked from commit d3ca14b2ee0d1cfd66a64424dcfb9d03884c0ef0) --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 177b0863a..cbbee2e37 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1186,7 +1186,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 dbe1c07d3..0f71ee4f0 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -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;