]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: fix return value for error in start
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 13 Apr 2022 15:40:26 +0000 (17:40 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 14 Apr 2022 13:08:16 +0000 (15:08 +0200)
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.

src/xprt_quic.c

index 6ab18d87110d6fd07d294b7b175f825b3d2d7fbc..528f7c01067eafa9b1a78e512e214d84f836b100 100644 (file)
@@ -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. */