]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-fcgi: Properly handle return value of headers/trailers parsing
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 28 Mar 2022 13:37:01 +0000 (15:37 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 28 Mar 2022 13:56:17 +0000 (15:56 +0200)
commitd9fc12818e4084f76cfa1f31d20a5c17d83ecb3e
treea977f3b46fe9b15012ac63a66b5e2f80ce689425
parent4646e9c9cbc04a413b9a84e2bfcab3b119e9f21b
BUG/MEDIUM: mux-fcgi: Properly handle return value of headers/trailers parsing

h1_parse_msg_hdrs() and h1_parse_msg_tlrs() may return negative values if
the parsing fails or if more space is needed in the destination buffer. When
h1-htx was changed, The H1 mux was updated accordingly but not the FCGI
mux. Thus if a negative value is returned, it is ignored and it is casted to
a size_t, leading to an integer overflow on the <ofs> value, used to know
the position in the RX buffer.

This patch must be backported as far as 2.2.
src/mux_fcgi.c