net.dns: Make sure argument to math.randomseed does not overflow a 32 bit *signed...
authorKim Alvefur <zash@zash.se>
Sun, 26 Apr 2015 17:50:24 +0000 (19:50 +0200)
committerKim Alvefur <zash@zash.se>
Sun, 26 Apr 2015 17:50:24 +0000 (19:50 +0200)
net/dns.lua

index 28cb44190eced9d73df3aaabbd582ca633c7eb57..763ee9ec644a6b230f78b325fa2768874f4e6e5b 100644 (file)
@@ -225,7 +225,7 @@ end
 
 
 function dns.random(...)    -- - - - - - - - - - - - - - - - - - -  dns.random
-       math.randomseed(math.floor(10000*socket.gettime()) % 0x100000000);
+       math.randomseed(math.floor(10000*socket.gettime()) % 0x80000000);
        dns.random = math.random;
        return dns.random(...);
 end