Skip to content

Commit

Permalink
CONF_modules_load_file_ex(): Do not try to load an empty file name
Browse files Browse the repository at this point in the history
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 #21282)

(cherry picked from commit 8b7d5ea)
  • Loading branch information
t8m committed Jun 27, 2023
1 parent 61892ab commit 5c56cef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crypto/conf/conf_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5c56cef

Please sign in to comment.