mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-16 08:21:01 +01:00
MINOR: h3: fix possible invalid dereference on htx parsing
The htx variable is only initialized if we have received a HTTP/3
HEADERS frame. Else it must not be dereferenced.
This should fix the compilation on CI with gcc.
src/h3.c: In function ‘h3_decode_qcs’:
src/h3.c:224:14: error: ‘htx’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
224 | htx->flags |= HTX_FL_EOM
This commit is contained in:
parent
a842ca1fca
commit
7059ebc095
4
src/h3.c
4
src/h3.c
@ -100,7 +100,7 @@ static int h3_decode_qcs(struct qcs *qcs, int fin, void *ctx)
|
|||||||
{
|
{
|
||||||
struct buffer *rxbuf = &qcs->rx.buf;
|
struct buffer *rxbuf = &qcs->rx.buf;
|
||||||
struct h3 *h3 = ctx;
|
struct h3 *h3 = ctx;
|
||||||
struct htx *htx;
|
struct htx *htx = NULL;
|
||||||
struct htx_sl *sl;
|
struct htx_sl *sl;
|
||||||
struct conn_stream *cs;
|
struct conn_stream *cs;
|
||||||
struct http_hdr list[global.tune.max_http_hdr];
|
struct http_hdr list[global.tune.max_http_hdr];
|
||||||
@ -220,8 +220,10 @@ static int h3_decode_qcs(struct qcs *qcs, int fin, void *ctx)
|
|||||||
b_del(rxbuf, flen);
|
b_del(rxbuf, flen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (htx) {
|
||||||
if (fin && !b_data(rxbuf))
|
if (fin && !b_data(rxbuf))
|
||||||
htx->flags |= HTX_FL_EOM;
|
htx->flags |= HTX_FL_EOM;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user