diff options
author | Pauli <pauli@openssl.org> | 2022-07-14 15:17:41 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-07-17 17:52:06 +1000 |
commit | 1d6c45694a1ae4ac5f9aa8f76dc1de68089f8a72 (patch) | |
tree | b3f2fe402599e18a1201930b930a07449bfdfdef /crypto/evp/mac_lib.c | |
parent | c7f5109e5f847ccb96b761774186ec0ff6c8fec6 (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)
(cherry picked from commit ee8db8c5fb5b091f48d29914126d35a7e29cdcf2)
Diffstat (limited to 'crypto/evp/mac_lib.c')
-rw-r--r-- | crypto/evp/mac_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/mac_lib.c b/crypto/evp/mac_lib.c index 24fdb35c8e..a49c103220 100644 --- a/crypto/evp/mac_lib.c +++ b/crypto/evp/mac_lib.c @@ -226,7 +226,7 @@ const char *EVP_MAC_get0_description(const EVP_MAC *mac) int EVP_MAC_is_a(const EVP_MAC *mac, const char *name) { - return evp_is_a(mac->prov, mac->name_id, NULL, name); + return mac != NULL && evp_is_a(mac->prov, mac->name_id, NULL, name); } int EVP_MAC_names_do_all(const EVP_MAC *mac, |