From dada9ff155e41dc789978b8879003518fbefb5b4 Mon Sep 17 00:00:00 2001 From: Erik Winkels Date: Tue, 4 Apr 2017 16:40:32 +0200 Subject: [PATCH] Fix matches overflow in dnsdist API. The way it is currently fixed means that matches can still overflow in the web interface because JavaScript has a 2^53 number limit. However, this fix is in line with how earlier cases have been fixed. --- pdns/dnsdist-web.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index ccecf1a48a..e913b88ba2 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -380,7 +380,7 @@ static void connectionThread(int sock, ComboAddress remote, string password, str for(const auto& a : localRules) { Json::object rule{ {"id", num++}, - {"matches", (int)a.first->d_matches}, + {"matches", (double)a.first->d_matches}, {"rule", a.first->toString()}, {"action", a.second->toString()}, {"action-stats", a.second->getStats()} @@ -394,7 +394,7 @@ static void connectionThread(int sock, ComboAddress remote, string password, str for(const auto& a : localResponseRules) { Json::object rule{ {"id", num++}, - {"matches", (int)a.first->d_matches}, + {"matches", (double)a.first->d_matches}, {"rule", a.first->toString()}, {"action", a.second->toString()}, }; -- 2.47.2