diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-06-26 11:11:57 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-06-27 14:48:33 +0200 |
commit | 8b7d5ea7dd602eb7c2c4bc5ad45489dc5fc711f6 (patch) | |
tree | 0a1d03e1cf2c57c238009e341dd79a264a0adf94 /crypto/conf | |
parent | 2c59d54cd7cb741c4547311ca1b8479e08dce0b7 (diff) |
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)
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_mod.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index 148ce6b524..38a8d4412f 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -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; |