]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-h1: don't swap buffers when transferring data with a reserved offset
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Oct 2026 09:37:59 +0000 (11:37 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Oct 2026 17:10:27 +0000 (19:10 +0200)
commit53536fd53db064ba3e4107fa45d28aa3bd109143
tree485e98ba13277a5324d86fdc04f7d445e776cfba
parentad08f80596717c76da651346cf740834da38b313
BUG/MEDIUM: mux-h1: don't swap buffers when transferring data with a reserved offset

In h1_nego_ff(), when the output is chunked, some room may be reserved to emit
the chunk size later, in h1_done_ff(). However, when the producer's buffer is
not empty, a first copy may be performed via the b_xfer() function. At this
stage the buffers may be swapped while it is not expected. The reserved space
may be moved and the head position lost.

In practice, it is pretty hard to hit the bug.

Now the data are always copied when room is reserved, using b_force_xfer().
b_xfer() is still used when no room is reserved.

This was introduced by commit e8cc8a60b in 3.1 (backported to 3.0). It
must be backported as far as 3.0.
src/mux_h1.c