Let ssl_get_prev_session reliably work in multi-threaded settings.
[openssl.git] / ssl / s3_srvr.c
index 9d2debf..e003d88 100644 (file)
@@ -557,7 +557,9 @@ static int ssl3_get_client_hello(SSL *s)
                        { /* previous session */
                        s->hit=1;
                        }
                        { /* previous session */
                        s->hit=1;
                        }
-               else
+               else if (i == -1)
+                       goto err;
+               else /* i == 0 */
                        {
                        if (!ssl_get_new_session(s,1))
                                goto err;
                        {
                        if (!ssl_get_new_session(s,1))
                                goto err;