From e49911ef6a2f1eded2e672bdaf71a4f3775b2c70 Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Wed, 18 Nov 2026 15:36:42 +0100 Subject: [PATCH] BUG/MINOR: quic/ssl: report SSL_CTX allocation failure ssl_quic_initial_ctx() stores the result of SSL_CTX_new() into bind_conf->initial_ctx without checking it, unlike ssl_sock_initial_ctx() which alerts and returns an error. On allocation failure the QUIC bind therefore crashed without any diagnostic. Report the failure the same way the TCP path does. Must be backported to all stable versions. --- src/quic_ssl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/quic_ssl.c b/src/quic_ssl.c index d22efef43..425a4333a 100644 --- a/src/quic_ssl.c +++ b/src/quic_ssl.c @@ -760,6 +760,13 @@ int ssl_quic_initial_ctx(struct bind_conf *bind_conf) SSL_CTX *ctx; ctx = SSL_CTX_new(TLS_server_method()); + if (!ctx) { + cfgerr += 1; + ha_alert("Proxy '%s': failed to create an SSL context for bind '%s' at [%s:%d].\n", + bind_conf->frontend->id, bind_conf->arg, bind_conf->file, bind_conf->line); + goto end; + } + bind_conf->initial_ctx = ctx; if (global_ssl.security_level > -1) @@ -836,7 +843,7 @@ int ssl_quic_initial_ctx(struct bind_conf *bind_conf) } #endif - + end: return cfgerr; } -- 2.47.3