mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
CONF_modules_load_file_ex(): Do not try to load an empty file name
Fixes #21258 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/21282)
This commit is contained in:
parent
2c59d54cd7
commit
8b7d5ea7dd
@ -184,15 +184,21 @@ int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
|
||||
CONF *conf = NULL;
|
||||
int ret = 0, diagnostics = 0;
|
||||
|
||||
ERR_set_mark();
|
||||
|
||||
if (filename == NULL) {
|
||||
file = CONF_get1_default_config_file();
|
||||
if (file == NULL)
|
||||
goto err;
|
||||
if (*file == '\0') {
|
||||
/* Do not try to load an empty file name but do not error out */
|
||||
ret = 1;
|
||||
goto err;
|
||||
}
|
||||
} else {
|
||||
file = (char *)filename;
|
||||
}
|
||||
|
||||
ERR_set_mark();
|
||||
conf = NCONF_new_ex(libctx, NULL);
|
||||
if (conf == NULL)
|
||||
goto err;
|
||||
|
Loading…
Reference in New Issue
Block a user