diff options
author | Pauli <pauli@openssl.org> | 2021-11-10 21:49:49 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-11-12 10:53:02 +0100 |
commit | ed5b26ce0b34ec00bdd53d15854a22bccbb4d415 (patch) | |
tree | bc5aef4074b3c2ed8dc2ca8cb4d428eaaaf2f41c /crypto/property | |
parent | x509: use safe maths calls for overflow detection (diff) | |
download | openssl-ed5b26ce0b34ec00bdd53d15854a22bccbb4d415.tar.xz openssl-ed5b26ce0b34ec00bdd53d15854a22bccbb4d415.zip |
Add return value NULL checks that were missing
Issues located by Brian Carpenter of Geeknik's Farm.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17007)
Diffstat (limited to 'crypto/property')
-rw-r--r-- | crypto/property/property.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/property/property.c b/crypto/property/property.c index 5df1bfc221..c087e741ed 100644 --- a/crypto/property/property.c +++ b/crypto/property/property.c @@ -118,7 +118,7 @@ OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OSSL_LIB_CTX *libctx, globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES, &ossl_ctx_global_properties_method); - return &globp->list; + return globp != NULL ? &globp->list : NULL; } #ifndef FIPS_MODULE @@ -128,7 +128,7 @@ int ossl_global_properties_no_mirrored(OSSL_LIB_CTX *libctx) = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES, &ossl_ctx_global_properties_method); - return globp->no_mirrored ? 1 : 0; + return globp != NULL && globp->no_mirrored ? 1 : 0; } void ossl_global_properties_stop_mirroring(OSSL_LIB_CTX *libctx) @@ -137,7 +137,8 @@ void ossl_global_properties_stop_mirroring(OSSL_LIB_CTX *libctx) = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES, &ossl_ctx_global_properties_method); - globp->no_mirrored = 1; + if (globp != NULL) + globp->no_mirrored = 1; } #endif |