]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: fix potential use of uninit pointer
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Dec 2021 15:32:24 +0000 (16:32 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Dec 2021 15:33:47 +0000 (16:33 +0100)
Properly initialized the ssl_sock_ctx pointer in qc_conn_init. This is
required to avoid to set an undefined pointer in qc.xprt_ctx if argument
*xprt_ctx is NULL.

src/xprt_quic.c

index f486ebad8343caa772169a3559e08d269df0636a..f2d549e343878b3468ef007c93b60a636daf1ceb 100644 (file)
@@ -5026,7 +5026,7 @@ static int qc_ssl_sess_init(struct quic_conn *qc, SSL_CTX *ssl_ctx, SSL **ssl,
  */
 static int qc_conn_init(struct connection *conn, void **xprt_ctx)
 {
-       struct ssl_sock_ctx *ctx;
+       struct ssl_sock_ctx *ctx = NULL;
        struct quic_conn *qc = NULL;
 
        TRACE_ENTER(QUIC_EV_CONN_NEW, conn);