Commit 32a33dae78 for openssl.org
commit 32a33dae788742c4511eade62336e2e814c7c68f
Author: Alexandr Nedvedicky <sashan@openssl.org>
Date: Thu Dec 4 08:38:04 2025 +0100
ssl_do_config(): Check for NULL name argument
Fixes 0c2a196af8ab9c12da27
Fixes Coverity issue 1675312
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29306)
diff --git a/ssl/ssl_mcnf.c b/ssl/ssl_mcnf.c
index 7bb69d90b8..b552d103a7 100644
--- a/ssl/ssl_mcnf.c
+++ b/ssl/ssl_mcnf.c
@@ -52,6 +52,12 @@ static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system)
if (name == NULL && system)
name = "system_default";
+ if (name == NULL) {
+ ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
+ "name not specified (name == NULL)");
+ goto err;
+ }
+
libctx = s != NULL ? s->ctx->libctx: ctx->libctx;
imod = ssl_do_lookup_module(libctx);
if (!conf_ssl_name_find(imod, name, &idx)) {