From b5624a63650cae1f09a5ca1169602174b05b58aa Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 10 Apr 2026 10:37:09 +0200 Subject: [PATCH] BUG/MINOR: mux_quic: prevent QMux crash on qcc_io_send() error path A QCC connection may be flagged with QC_CF_ERRL to trigger a CONNECTION_CLOSE emission. However, for now error reporting is not functional with QMux, as it relies on quic_conn layer access. To prevent a crash in qcc_io_send() when using QMux, add a conn_is_quic() check when QC_CF_ERRL is set to ensure no access will be performed on quic_conn layer. In the future, this should be extended so that QMux is also able to emit CONNECTION_CLOSE for connection closure. No need to backport. --- src/mux_quic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mux_quic.c b/src/mux_quic.c index 0ea65fefc..0fe0c7c6f 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -3032,7 +3032,9 @@ static int qcc_io_send(struct qcc *qcc) /* Prepare a CONNECTION_CLOSE if not already done. */ if (!(qcc->flags & QC_CF_ERRL_DONE)) { TRACE_DATA("report a connection error", QMUX_EV_QCC_SEND|QMUX_EV_QCC_ERR, qcc->conn); - quic_set_connection_close(qcc->conn->handle.qc, qcc->err); + /* TODO implement a QMux alternative */ + if (conn_is_quic(qcc->conn)) + quic_set_connection_close(qcc->conn->handle.qc, qcc->err); qcc->flags |= QC_CF_ERRL_DONE; } goto out;