From cd8da4a60d5b3924953247f714a9df495b289093 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 5 Mar 2013 10:04:31 +0100 Subject: net.dns: Make sure argument to math.randomseed does not overflow a 32 bit unsigned int. Closes #320 --- net/dns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/dns.lua') 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 -- cgit v1.2.3