mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
MINOR: quic: Fix potential null pointer dereference
Fix compilation warnings about non initialized pointers. This partially address #1445 github issue.
This commit is contained in:
parent
b9ce14e5a2
commit
c4becf5424
@ -178,7 +178,7 @@ void quic_sock_fd_iocb(int fd)
|
|||||||
struct rxbuf *rxbuf;
|
struct rxbuf *rxbuf;
|
||||||
struct buffer *buf;
|
struct buffer *buf;
|
||||||
struct listener *l = objt_listener(fdtab[fd].owner);
|
struct listener *l = objt_listener(fdtab[fd].owner);
|
||||||
struct quic_transport_params *params = &l->bind_conf->quic_params;
|
struct quic_transport_params *params;
|
||||||
/* Source address */
|
/* Source address */
|
||||||
struct sockaddr_storage saddr = {0};
|
struct sockaddr_storage saddr = {0};
|
||||||
size_t max_sz;
|
size_t max_sz;
|
||||||
@ -186,11 +186,18 @@ void quic_sock_fd_iocb(int fd)
|
|||||||
|
|
||||||
BUG_ON(!l);
|
BUG_ON(!l);
|
||||||
|
|
||||||
|
if (!l)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!(fdtab[fd].state & FD_POLL_IN) || !fd_recv_ready(fd))
|
if (!(fdtab[fd].state & FD_POLL_IN) || !fd_recv_ready(fd))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rxbuf = MT_LIST_POP(&l->rx.rxbuf_list, typeof(rxbuf), mt_list);
|
rxbuf = MT_LIST_POP(&l->rx.rxbuf_list, typeof(rxbuf), mt_list);
|
||||||
buf = &rxbuf->buf;
|
buf = &rxbuf->buf;
|
||||||
|
if (!buf)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
params = &l->bind_conf->quic_params;
|
||||||
max_sz = params->max_udp_payload_size;
|
max_sz = params->max_udp_payload_size;
|
||||||
if (b_contig_space(buf) < max_sz) {
|
if (b_contig_space(buf) < max_sz) {
|
||||||
/* Note that when we enter this function, <buf> is always empty */
|
/* Note that when we enter this function, <buf> is always empty */
|
||||||
|
@ -3309,6 +3309,7 @@ static ssize_t qc_srv_pkt_rcv(unsigned char **buf, const unsigned char *end,
|
|||||||
struct quic_enc_level *qel;
|
struct quic_enc_level *qel;
|
||||||
|
|
||||||
qc = NULL;
|
qc = NULL;
|
||||||
|
qel = NULL;
|
||||||
TRACE_ENTER(QUIC_EV_CONN_SPKT);
|
TRACE_ENTER(QUIC_EV_CONN_SPKT);
|
||||||
if (end <= *buf)
|
if (end <= *buf)
|
||||||
goto err;
|
goto err;
|
||||||
@ -3461,6 +3462,7 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char **buf, const unsigned char *end,
|
|||||||
|
|
||||||
qc = NULL;
|
qc = NULL;
|
||||||
conn_ctx = NULL;
|
conn_ctx = NULL;
|
||||||
|
qel = NULL;
|
||||||
TRACE_ENTER(QUIC_EV_CONN_LPKT, NULL, pkt);
|
TRACE_ENTER(QUIC_EV_CONN_LPKT, NULL, pkt);
|
||||||
if (end <= *buf)
|
if (end <= *buf)
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
Reference in New Issue
Block a user