From 08118a3d91931f8f14577ac543dc3af195183e0f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 26 Apr 2015 19:50:24 +0200 Subject: net.dns: Make sure argument to math.randomseed does not overflow a 32 bit *signed* int (blame Lua). Closes #439 --- 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 28cb4419..763ee9ec 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -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 -- cgit v1.2.3