Changeset

6645:4f934cf03bc9

net.dns: Make sure argument to math.randomseed does not overflow a 32 bit *signed* int (blame Lua). Closes #439
author Kim Alvefur <zash@zash.se>
date Sun, 26 Apr 2015 19:50:24 +0200
parents 6644:6cb6855f60df
children 6646:9795b8cf14f1 6680:ae34b12c4335
files net/dns.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/dns.lua	Fri Apr 03 12:10:30 2015 +0200
+++ b/net/dns.lua	Sun Apr 26 19:50:24 2015 +0200
@@ -225,7 +225,7 @@
 
 
 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