Commit af93910d authored by Michael Hanus's avatar Michael Hanus
Browse files

Fixes security issue w.r.t. random seeds w.r.t. zero minutes

parent e71405d2
......@@ -191,9 +191,9 @@ getRandomSeed =
getCPUTime >>= \msecs ->
let (CalendarTime y mo d h m s _) = toUTCTime time
#ifdef __PAKCS__
in return ((y+mo+d+h+m*s*msecs) `rem` mask)
in return ((y+mo+d+h+(m+1)*(s+1)*(msecs+1)) `rem` mask)
#else
in return ((y+mo+d+h+m*s*(msecs+1)) `mod` two16)
in return ((y+mo+d+h+(m+1)*(s+1)*(msecs+1)) `mod` two16)
#endif
--- Computes a random permutation of the given list.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment