diff options
author | Kim Alvefur <zash@zash.se> | 2013-03-05 10:04:31 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-03-05 10:04:31 +0100 |
commit | 38b1fed51e1f2ea4174870f01ba815e0c32a5225 (patch) | |
tree | 93c5adac840bbc7c1e7956e06af0b41dcc90aac0 | |
parent | 4cf76d88d4cf2b2db3e704812561f229d4524058 (diff) | |
download | prosody-38b1fed51e1f2ea4174870f01ba815e0c32a5225.tar.gz prosody-38b1fed51e1f2ea4174870f01ba815e0c32a5225.zip |
net.dns: Make sure argument to math.randomseed does not overflow a 32 bit unsigned int. Closes #320
-rw-r--r-- | net/dns.lua | 2 |
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 |