summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-09-08 10:41:51 -0400
committerNick Mathewson <nickm@torproject.org>2015-09-08 10:41:51 -0400
commit4c6fd7106fdf1a31c1e50a992c03dac69cd25a47 (patch)
tree07e9d8b4620bf1c74602b0c780c29ec816004945 /src
parent81e3deeb54d2f3d022655c6a51f966ef44bf6fb3 (diff)
parent280672bdbc2c694ebe17f9972657d118e84be723 (diff)
downloadtor-4c6fd7106fdf1a31c1e50a992c03dac69cd25a47.tar.gz
tor-4c6fd7106fdf1a31c1e50a992c03dac69cd25a47.zip
Merge branch 'bug16980'
Diffstat (limited to 'src')
-rw-r--r--src/common/crypto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 6d4b0d7e16..815c2ec0c5 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -2440,7 +2440,8 @@ crypto_rand_uint64_range(uint64_t min, uint64_t max)
time_t
crypto_rand_time_range(time_t min, time_t max)
{
- return (time_t) crypto_rand_uint64_range(min, max);
+ tor_assert(min < max);
+ return min + (time_t)crypto_rand_uint64(max - min);
}
/** Return a pseudorandom 64-bit integer, chosen uniformly from the values