]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: applet: check buffer sizes before HTX transfer
authorAdam Crawford <adamcrawford253@gmail.com>
Mon, 26 Oct 2026 04:21:40 +0000 (23:21 -0500)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 Oct 2026 13:17:17 +0000 (14:17 +0100)
commitb820db493779afe2bceaa28918d9d0b94744e746
tree8754ecc66ff6c70ebbb634666a056d799fe9eab1
parentad6346fdf3a87c99656e5a8c0ffddffa7d9e9b70
BUG/MEDIUM: applet: check buffer sizes before HTX transfer

The appctx_htx_snd_buf() fast path uses b_xfer() when the destination
HTX message is empty and the source contains a complete HTX message.
However, it does not verify that both buffers have the same capacity.

When tune.bufsize.large is configured and wait-for-body uses
use-large-buffer, the channel buffer may be larger than the applet
input buffer. The fast path can then attempt to transfer more data
than the destination can hold, triggering a fatal bounds check and
terminating the worker process.

Only use the fast path when the source and destination buffers have
the same capacity. Otherwise, use the existing HTX block-wise transfer
path.

[cf: Must be backported to 3.4]
src/applet.c