summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-06-09 16:27:05 +0200
committerPauli <pauli@openssl.org>2021-06-11 08:52:14 +1000
commit6cf811e8678b23d03621c94a562181eb73ccc2e0 (patch)
tree9cef7d768e72d8626592fe00911c1615037e03da /crypto
parent7afef721ff93018a66f8e2e6b9e1ce3d48321bdf (diff)
ossl_provider_set_module_path: Prevent potential UAF
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15680)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/provider_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/provider_core.c b/crypto/provider_core.c
index 30fa44d789..c6a8fa3f26 100644
--- a/crypto/provider_core.c
+++ b/crypto/provider_core.c
@@ -483,6 +483,7 @@ void ossl_provider_free(OSSL_PROVIDER *prov)
int ossl_provider_set_module_path(OSSL_PROVIDER *prov, const char *module_path)
{
OPENSSL_free(prov->path);
+ prov->path = NULL;
if (module_path == NULL)
return 1;
if ((prov->path = OPENSSL_strdup(module_path)) != NULL)