From 9c15325d34798501266146dffc2bfbe7cb788102 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 15 Jul 2013 13:20:44 +0200 Subject: sslgen.c: fix unreleased Curl_rand() infinite recursion --- lib/sslgen.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') 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. */ -- cgit v1.2.3