]> granicus.if.org Git - pdns/commitdiff
Fix "queries" overflow in dnsdist API.
authorErik Winkels <erik.winkels@powerdns.com>
Tue, 11 Apr 2017 12:22:30 +0000 (14:22 +0200)
committerErik Winkels <erik.winkels@powerdns.com>
Tue, 11 Apr 2017 12:22:30 +0000 (14:22 +0200)
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.

This fixes issue #5054.

pdns/dnsdist-web.cc

index e913b88ba2aeffbe275467483dd4908b4f825bda..f82fe5f66de3cc440a3e31250b2ca2b97120a681 100644 (file)
@@ -349,7 +349,7 @@ static void connectionThread(int sock, ComboAddress remote, string password, str
           {"order", (int)a->order},
           {"pools", pools},
           {"latency", (int)(a->latencyUsec/1000.0)},
-          {"queries", (int)a->queries}};
+          {"queries", (double)a->queries}};
 
         /* sending a latency for a DOWN server doesn't make sense */
         if (a->availability == DownstreamState::Availability::Down) {