]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: flt-http-comp: check the block returned by htx_replace_blk_value()
authorWilly Tarreau <w@1wt.eu>
Sat, 31 Oct 2026 07:57:19 +0000 (08:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2026 08:31:27 +0000 (09:31 +0100)
commita4ecfdd49e95ec412d79815e2fd210100b0c2183
treee745ab3909fc003db6049b5f1636dd8169791c9f
parent1e11132396b17ca404e94155d1fcb90cbabd4c37
BUG/MINOR: flt-http-comp: check the block returned by htx_replace_blk_value()

comp_http_payload() replaces the value of a DATA block with the deflater's
output and directly passes the result to htx_get_next_blk(), without checking
it. htx_replace_blk_value() returns NULL when htx_prepare_blk_expansion()
finds not enough room for the new value (delta > htx_free_space()). Normally
this cannot happen, but it seldom does during development or improvements
on the compression libraries, and causes crashes that could just be turned
into errors. The decompression code already performs the test, so let's do
the same and stay safe in front of such occasional early bugs. It's not
necessary to backport this since it doesn't trigger with stable code.
src/flt_http_comp.c