mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
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)
This commit is contained in:
parent
7afef721ff
commit
6cf811e867
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user