From: Amaury Denoyelle Date: Wed, 13 Apr 2022 15:40:26 +0000 (+0200) Subject: BUG/MINOR: quic: fix return value for error in start X-Git-Tag: v2.6-dev6~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05d4ae64365cd0c49de165d8fca78178a74e21c2;p=thirdparty%2Fhaproxy.git BUG/MINOR: quic: fix return value for error in start Fix the return value used in quic-conn start callback for error. The caller expects a negative value in this case. Without this patch, the quic-conn and the connection stack are not closed despite an initialization failure error, which is an undefined behavior and may cause a crash in the end. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 6ab18d8711..528f7c0106 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -5756,7 +5756,7 @@ static int qc_xprt_start(struct connection *conn, void *ctx) qc = conn->handle.qc; if (qcc_install_app_ops(qc->qcc, qc->app_ops)) { TRACE_PROTO("Cannot install app layer", QUIC_EV_CONN_LPKT, qc); - return 0; + return -1; } /* mux-quic can now be considered ready. */