]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: htx: Fix function used to change part of a block value when defrag
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 11 Feb 2026 14:43:51 +0000 (15:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Feb 2026 12:26:21 +0000 (13:26 +0100)
commita8887e55a04a70ffb458b4cc42fab41b5460d9e1
tree71f58a5de9886945fbc79c8ccd111f658904775b
parente62e8de5a782671a00ca81e6bd145de7a3635b38
BUG/MEDIUM: htx: Fix function used to change part of a block value when defrag

htx_replace_blk_value() is buggy when a defrag is performed. It only happens
on data expension. But in that case, because a defragmentation is performed,
the blocks data are moved and old data of the updated block are no longer
accessible.

To fix the bug, we now use a chunk to temporarily copy the new data of the
block. This way we can safely perform the HTX defragmentation and then
recopy the data from the chunk to the HTX message.

It is theorically possible to hit this bug but concretly it is pretty hard.

This patch should be backported to all stable versions.
src/htx.c