From 07c10ec2f124801b1d58454f13c331c5a0b77b0e Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Wed, 10 Sep 2025 12:03:01 +0200 Subject: [PATCH] BUG/MEDIUM: ssl: Fix a crash if we failed to create the mux In ssl_sock_io_cb(), if we failed to create the mux, we may have destroyed the connection, so only attempt to access it to get the ALPN if conn_create_mux() was successful. This fixes crashes that may happen when using ssl. --- src/ssl_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl_sock.c b/src/ssl_sock.c index bc3008a1b..d47ce1f26 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -6500,7 +6500,7 @@ struct task *ssl_sock_io_cb(struct task *t, void *context, unsigned int state) * already, and immediately know which mux * to use, in case we want to use 0RTT. */ - if (conn_is_back(conn)) { + if (ret >= 0 && conn_is_back(conn)) { struct server *srv; const char *alpn; int len;