sslgen.c: fix unreleased Curl_rand() infinite recursion
authorYang Tse <yangsita@gmail.com>
Mon, 15 Jul 2013 11:20:44 +0000 (13:20 +0200)
committerYang Tse <yangsita@gmail.com>
Mon, 15 Jul 2013 11:22:08 +0000 (13:22 +0200)
lib/sslgen.c

index ba995cb..a633b0c 100644 (file)
@@ -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. */