summaryrefslogtreecommitdiffstats
path: root/crypto/property
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-11-10 21:49:49 +0100
committerPauli <pauli@openssl.org>2021-11-12 10:53:02 +0100
commited5b26ce0b34ec00bdd53d15854a22bccbb4d415 (patch)
treebc5aef4074b3c2ed8dc2ca8cb4d428eaaaf2f41c /crypto/property
parentx509: use safe maths calls for overflow detection (diff)
downloadopenssl-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.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