From e02939108e418f7637efd781473071695f201958 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 22 Jul 2025 09:39:27 +0200 Subject: [PATCH] BUG/MINOR: h3: fix uninitialized value in h3_req_headers_send() Due to the introduction of smallbuf usage for HTTP/3 headers emission, ret variable may be used uninitialized if buffer allocation fails due to not enough room in QUIC connection window. Fix this by setting ret value to 0. Function variable declaration are also adjusted so that the pattern is similar to h3_resp_headers_send(). Finally, outbuf buffer is also removed as it is now unused. No need to backport. --- src/h3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/h3.c b/src/h3.c index 0feee7fa6..e9444c76f 100644 --- a/src/h3.c +++ b/src/h3.c @@ -2002,8 +2002,8 @@ static int h3_encode_header(struct buffer *buf, */ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx) { + int err; struct http_hdr list[global.tune.max_http_hdr * 2]; - struct buffer outbuf; struct buffer headers_buf = BUF_NULL; struct buffer *res; enum htx_blk_type type; @@ -2012,7 +2012,8 @@ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx) struct ist meth, uri, scheme = IST_NULL, auth = IST_NULL; int frame_length_size; /* size in bytes of frame length varint field */ int smallbuf = 1; - int ret, err, hdr; + int ret = 0; + int hdr; TRACE_ENTER(H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs); -- 2.47.2