check return value of RAND_pseudo_bytes; backport from the stable branch
[openssl.git] / ssl / s3_clnt.c
index b40571dd5a6417e90cb7f939f97431c518e58625..fc376cb04d8563981c1e6744c0c881c7966841dc 100644 (file)
@@ -552,7 +552,8 @@ int ssl3_client_hello(SSL *s)
                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]);