diff options
author | Hans Nilsson <[email protected]> | 2017-11-20 16:55:31 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-11-20 16:56:42 +0100 |
commit | f99f4c02676686935276f0df07c1eb6e2ae35fe7 (patch) | |
tree | cfb6b5b3bd9f6d71347215c3278eb02b51f21113 /lib/crypto | |
parent | 27d73755ff62a828be8a14597a20e7762049c727 (diff) | |
download | otp-f99f4c02676686935276f0df07c1eb6e2ae35fe7.tar.gz otp-f99f4c02676686935276f0df07c1eb6e2ae35fe7.tar.bz2 otp-f99f4c02676686935276f0df07c1eb6e2ae35fe7.zip |
Remove core dump risk in crypto.c
Diffstat (limited to 'lib/crypto')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index b29c5082ba..ec77bf88bb 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -4011,7 +4011,7 @@ static int get_pkey_private_key(ErlNifEnv *env, ERL_NIF_TERM algorithm, ERL_NIF_ return PKEY_BADARG; password = get_key_password(env, key); *pkey = ENGINE_load_private_key(e, id, NULL, password); - if (!pkey) + if (!*pkey) return PKEY_BADARG; enif_free(id); #else @@ -4795,7 +4795,6 @@ static ERL_NIF_TERM privkey_to_pubkey_nif(ErlNifEnv* env, int argc, const ERL_NI EVP_PKEY *pkey; ERL_NIF_TERM alg = argv[0]; ERL_NIF_TERM result[8]; - if (get_pkey_private_key(env, alg, argv[1], &pkey) != PKEY_OK) { return enif_make_badarg(env); } |