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/evp_rand.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/evp_rand.c')
-rw-r--r-- | crypto/evp/evp_rand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/evp_rand.c b/crypto/evp/evp_rand.c index 0db755e06b..e92108abb1 100644 --- a/crypto/evp/evp_rand.c +++ b/crypto/evp/evp_rand.c @@ -305,7 +305,7 @@ const char *EVP_RAND_get0_description(const EVP_RAND *rand) int EVP_RAND_is_a(const EVP_RAND *rand, const char *name) { - return evp_is_a(rand->prov, rand->name_id, NULL, name); + return rand != NULL && evp_is_a(rand->prov, rand->name_id, NULL, name); } const OSSL_PROVIDER *EVP_RAND_get0_provider(const EVP_RAND *rand) |