diff options
author | Bodo Möller <bodo@openssl.org> | 2002-09-25 15:38:57 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2002-09-25 15:38:57 +0000 |
commit | b8565a9af9c6a4113b11764d2f79e799266a33c0 (patch) | |
tree | c784d28d5213a900b0783b8bff9efbe24c1950fd /ssl/t1_srvr.c | |
parent | 94960c84215f89cc7f655ad13418fbb38e597ed2 (diff) | |
download | openssl-new-b8565a9af9c6a4113b11764d2f79e799266a33c0.tar.gz |
really fix race conditions
Submitted by: "Patrick McCormick" <patrick@tellme.com>
PR: 262
PR: 291
Diffstat (limited to 'ssl/t1_srvr.c')
-rw-r--r-- | ssl/t1_srvr.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ssl/t1_srvr.c b/ssl/t1_srvr.c index c72e5525ae..1c1149e49f 100644 --- a/ssl/t1_srvr.c +++ b/ssl/t1_srvr.c @@ -82,12 +82,15 @@ SSL_METHOD *TLSv1_server_method(void) { CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD); - memcpy((char *)&TLSv1_server_data,(char *)tlsv1_base_method(), - sizeof(SSL_METHOD)); - TLSv1_server_data.ssl_accept=ssl3_accept; - TLSv1_server_data.get_ssl_method=tls1_get_server_method; - init=0; - + if (init) + { + memcpy((char *)&TLSv1_server_data,(char *)tlsv1_base_method(), + sizeof(SSL_METHOD)); + TLSv1_server_data.ssl_accept=ssl3_accept; + TLSv1_server_data.get_ssl_method=tls1_get_server_method; + init=0; + } + CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD); } return(&TLSv1_server_data); |