diff options
author | Pauli <pauli@openssl.org> | 2022-07-14 15:17:41 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-07-17 17:51:13 +1000 |
commit | ee8db8c5fb5b091f48d29914126d35a7e29cdcf2 (patch) | |
tree | e6c9238df232c6ecec6a57586e054b31a71e0fd5 /crypto/evp/exchange.c | |
parent | f80910390cb882f346fe59c9803fc914b9c367c2 (diff) |
evp: make all _is_a functions accept and handle a NULL argument
Makes life easier for callers.
Fixes Coverity 1503326
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18799)
Diffstat (limited to 'crypto/evp/exchange.c')
-rw-r--r-- | crypto/evp/exchange.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/evp/exchange.c b/crypto/evp/exchange.c index 4d5f8adbca..e80ec566dd 100644 --- a/crypto/evp/exchange.c +++ b/crypto/evp/exchange.c @@ -556,7 +556,8 @@ const char *EVP_KEYEXCH_get0_description(const EVP_KEYEXCH *keyexch) int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name) { - return evp_is_a(keyexch->prov, keyexch->name_id, NULL, name); + return keyexch != NULL + && evp_is_a(keyexch->prov, keyexch->name_id, NULL, name); } void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx, |