From d3ca14b2ee0d1cfd66a64424dcfb9d03884c0ef0 Mon Sep 17 00:00:00 2001 From: phonedph1 Date: Tue, 4 Sep 2018 22:05:56 +0000 Subject: [PATCH] Print possibly empty dnsnames safer --- pdns/rec_channel_rec.cc | 2 +- pdns/ws-recursor.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 6ff2a84e0..e3f02a282 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 1b3a8c990..a3eb224a3 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; -- 2.40.0