aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand/md_rand.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>1999-04-22 13:37:46 +0000
committerBodo Möller <bodo@openssl.org>1999-04-22 13:37:46 +0000
commit5cc146f344bd2225e7afa66052a8401468b94ef4 (patch)
treefed6103a36e32b130cb0ec6ba4ae6c4c9540f848 /crypto/rand/md_rand.c
parent4cd401e401c4526768f0ca9257129e749431b384 (diff)
downloadopenssl-5cc146f344bd2225e7afa66052a8401468b94ef4.zip
openssl-5cc146f344bd2225e7afa66052a8401468b94ef4.tar.gz
openssl-5cc146f344bd2225e7afa66052a8401468b94ef4.tar.bz2
Fixed some race conditions.
Submitted by: Reviewed by: PR:
Diffstat (limited to 'crypto/rand/md_rand.c')
-rw-r--r--crypto/rand/md_rand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index dbf13e6..5b2db35 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -241,7 +241,6 @@ static void ssleay_rand_bytes(unsigned char *buf, int num)
if (init)
{
- init=0;
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
/* put in some default random data, we need more than
* just this */
@@ -281,6 +280,7 @@ static void ssleay_rand_bytes(unsigned char *buf, int num)
memset(md,0,MD_DIGEST_LENGTH);
#endif
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
+ init=0;
}
st_idx=state_index;