]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: quic: fix potential NULL dereference on xprt_quic
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 19 Nov 2021 14:49:29 +0000 (15:49 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 19 Nov 2021 14:55:19 +0000 (15:55 +0100)
A warning is triggered by gcc9 on this code path, which is the compiler
version used by ubuntu20.04 on the github CI.

This is linked to github issue #1445.

src/quic_sock.c

index a574de0c0de4e43b9902cf6a9662737fd82192d5..38a8aab4b558f103fb9912fed24f420183ea741a 100644 (file)
@@ -191,9 +191,9 @@ void quic_sock_fd_iocb(int fd)
                return;
 
        rxbuf = MT_LIST_POP(&l->rx.rxbuf_list, typeof(rxbuf), mt_list);
-       buf = &rxbuf->buf;
-       if (!buf)
+       if (!rxbuf)
                goto out;
+       buf = &rxbuf->buf;
 
        params = &l->bind_conf->quic_params;
        max_sz = params->max_udp_payload_size;