]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: ssl: Fix a crash if we failed to create the mux
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 10 Sep 2025 10:03:01 +0000 (12:03 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 10 Sep 2025 10:02:53 +0000 (12:02 +0200)
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

index bc3008a1b48548c6768f1f0566bb0804dd935e80..d47ce1f26b4c09ebb334e1c8392bd84206306ffb 100644 (file)
@@ -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;