summaryrefslogtreecommitdiff
path: root/src/node_crypto_bio.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-07-26 12:54:46 +0200
committerJames M Snell <jasnell@gmail.com>2018-08-12 03:58:49 -0700
commit40ae307071e505ecc85cf31c70e5644e385c9be4 (patch)
tree105dbdd578cf480cbefc7c0b0a3193cce708c665 /src/node_crypto_bio.cc
parent987dc0711137685dabf472ad8e137ad365013557 (diff)
downloadnode-new-40ae307071e505ecc85cf31c70e5644e385c9be4.tar.gz
src: avoid possible race during NodeBIO initialization
PR-URL: https://github.com/nodejs/node/pull/21984 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_crypto_bio.cc')
-rw-r--r--src/node_crypto_bio.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc
index ab68c0a081..baa90204f2 100644
--- a/src/node_crypto_bio.cc
+++ b/src/node_crypto_bio.cc
@@ -247,6 +247,8 @@ const BIO_METHOD* NodeBIO::GetMethod() {
return &method;
#else
+ // This is called from InitCryptoOnce() to avoid race conditions during
+ // initialization.
static BIO_METHOD* method = nullptr;
if (method == nullptr) {