aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-03-05 10:04:31 +0100
committerKim Alvefur <zash@zash.se>2013-03-05 10:04:31 +0100
commitcd8da4a60d5b3924953247f714a9df495b289093 (patch)
tree93c5adac840bbc7c1e7956e06af0b41dcc90aac0 /net
parentbc1d59837587cf8349925f52cb57b1a77b10d824 (diff)
downloadprosody-cd8da4a60d5b3924953247f714a9df495b289093.tar.gz
prosody-cd8da4a60d5b3924953247f714a9df495b289093.zip
net.dns: Make sure argument to math.randomseed does not overflow a 32 bit unsigned int. Closes #320
Diffstat (limited to 'net')
-rw-r--r--net/dns.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dns.lua b/net/dns.lua
index a134eceb..c9c51fe8 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -223,7 +223,7 @@ end
function dns.random(...) -- - - - - - - - - - - - - - - - - - - dns.random
- math.randomseed(math.floor(10000*socket.gettime()));
+ math.randomseed(math.floor(10000*socket.gettime()) % 0x100000000);
dns.random = math.random;
return dns.random(...);
end