summaryrefslogtreecommitdiffstats
path: root/crypto/property
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-11-11 06:49:49 +1000
committerPauli <pauli@openssl.org>2021-11-12 19:53:54 +1000
commit648a15d6f5004f6f2ad88ea829adc7d29c638165 (patch)
treeaac13d744938ff66772244f55f0c1d07fbae78d1 /crypto/property
parentc37ff82e7c3993292fcc0524e5dde429fa3b65eb (diff)
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) (cherry picked from commit ed5b26ce0b34ec00bdd53d15854a22bccbb4d415)
Diffstat (limited to 'crypto/property')
-rw-r--r--crypto/property/property.c7
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