aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2013-07-15 13:20:44 +0200
committerYang Tse <yangsita@gmail.com>2013-07-15 13:22:08 +0200
commit9c15325d34798501266146dffc2bfbe7cb788102 (patch)
tree0bb88bdae6addc14c4f83860b331a7dcf07c9fa3 /lib
parentd8c04909fa50e87bba58311dd8feecaa94508f4b (diff)
sslgen.c: fix unreleased Curl_rand() infinite recursion
Diffstat (limited to 'lib')
-rw-r--r--lib/sslgen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sslgen.c b/lib/sslgen.c
index ba995cb5d..a633b0c5d 100644
--- a/lib/sslgen.c
+++ b/lib/sslgen.c
@@ -209,9 +209,10 @@ unsigned int Curl_rand(struct SessionHandle *data)
{
struct timeval now = curlx_tvnow();
randseed += (unsigned int) now.tv_usec + (unsigned int)now.tv_sec;
- Curl_rand(data);
- Curl_rand(data);
- Curl_rand(data);
+ randseed = randseed * 1103515245 + 12345;
+ randseed = randseed * 1103515245 + 12345;
+ randseed = randseed * 1103515245 + 12345;
+ seeded = TRUE;
}
}
/* Return an unsigned 32-bit pseudo-random number. */