From: Frederic Lecaille Date: Wed, 18 Nov 2026 14:36:42 +0000 (+0100) Subject: BUG/MINOR: quic/ssl: report SSL_CTX allocation failure X-Git-Tag: v3.5-dev13~4 X-Git-Url: https://git.kaiwu.me/web//%22?a=commitdiff_plain;h=e49911ef6a2f1eded2e672bdaf71a4f3775b2c70;p=haproxy.git 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. --- 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; }