check return value of RAND_pseudo_bytes; backport from the stable branch
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index b40571d..fc376cb 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -552,7 +552,8 @@
 		p=s->s3->client_random;
 		Time=time(NULL);			/* Time */
 		l2n(Time,p);
-		RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4);
+		if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0)
+			goto err;
 
 		/* Do the message type and length last */
 		d=p= &(buf[4]);