diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-07-02 15:45:09 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-07-05 12:44:54 +1000 |
commit | 0a02c81f8173e0c5d554bd16daa68b7594f4cbd8 (patch) | |
tree | 4ca02649f02c10470e3967296c79ee40d369cf58 /crypto | |
parent | f7546162d406be1f93bb39fb5a968521162b9acf (diff) |
Coverity #1486687: fix potential dereference of NULL keymgmt
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15986)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/encode_decode/decoder_pkey.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index 719bd17b2f..edbea4face 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -126,9 +126,9 @@ static int decoder_construct_pkey(OSSL_DECODER_INSTANCE *decoder_inst, /* To allow it to be freed further down */ if (!EVP_KEYMGMT_up_ref(keymgmt)) return 0; - } else { - keymgmt = EVP_KEYMGMT_fetch(data->libctx, - data->object_type, data->propq); + } else if ((keymgmt = EVP_KEYMGMT_fetch(data->libctx, + data->object_type, + data->propq)) != NULL) { keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt); } |