mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
BUG/MINOR: quic: NULL pointer dereferences when building post handshake frames.
The second one was detected by cppcheck contrary to the first one. Fixes issue #1032. Thank you to Ilya for having reported this.
This commit is contained in:
parent
de79cd28ec
commit
153d4a89d0
@ -1871,6 +1871,9 @@ static int quic_build_post_handshake_frames(struct quic_conn *conn)
|
|||||||
/* Only servers must send a HANDSHAKE_DONE frame. */
|
/* Only servers must send a HANDSHAKE_DONE frame. */
|
||||||
if (!objt_server(conn->conn->target)) {
|
if (!objt_server(conn->conn->target)) {
|
||||||
frm = pool_alloc(pool_head_quic_frame);
|
frm = pool_alloc(pool_head_quic_frame);
|
||||||
|
if (!frm)
|
||||||
|
return 0;
|
||||||
|
|
||||||
frm->type = QUIC_FT_HANDSHAKE_DONE;
|
frm->type = QUIC_FT_HANDSHAKE_DONE;
|
||||||
LIST_ADDQ(&conn->tx.frms_to_send, &frm->list);
|
LIST_ADDQ(&conn->tx.frms_to_send, &frm->list);
|
||||||
}
|
}
|
||||||
@ -1879,7 +1882,6 @@ static int quic_build_post_handshake_frames(struct quic_conn *conn)
|
|||||||
struct quic_connection_id *cid;
|
struct quic_connection_id *cid;
|
||||||
|
|
||||||
frm = pool_alloc(pool_head_quic_frame);
|
frm = pool_alloc(pool_head_quic_frame);
|
||||||
memset(frm, 0, sizeof *frm);
|
|
||||||
cid = new_quic_cid(&conn->cids, i);
|
cid = new_quic_cid(&conn->cids, i);
|
||||||
if (!frm || !cid)
|
if (!frm || !cid)
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
Reference in New Issue
Block a user