aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-05-17 18:46:41 +0200
committerSverker Eriksson <[email protected]>2018-05-17 18:46:41 +0200
commit4b8a81dd49fbeda8f2da118d43f3690a61f2283a (patch)
treedb8fd41d748f1b0622cf2ab3b65bd3a2b439e1f3
parent44b09e036b31b29dddc3b178e8f6b9fc96a9a874 (diff)
downloadotp-4b8a81dd49fbeda8f2da118d43f3690a61f2283a.tar.gz
otp-4b8a81dd49fbeda8f2da118d43f3690a61f2283a.tar.bz2
otp-4b8a81dd49fbeda8f2da118d43f3690a61f2283a.zip
crypto: Fix upgrade bug when engine support is missing
library_refc was not checked causing crash when init_digest_types() was called a second time.
-rw-r--r--lib/crypto/c_src/crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 6957d25774..9e7e1e81ae 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -989,6 +989,7 @@ static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info)
PRINTF_ERR0("CRYPTO: Could not open resource type 'ENGINE_CTX'");
return __LINE__;
}
+#endif
if (library_refc > 0) {
/* Repeated loading of this library (module upgrade).
@@ -996,7 +997,6 @@ static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info)
*/
return 0;
}
-#endif
atom_true = enif_make_atom(env,"true");
atom_false = enif_make_atom(env,"false");