]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: htx: Fix headers rollback on partial copy in htx_xfer()
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Jun 2026 07:45:32 +0000 (09:45 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Jun 2026 07:59:33 +0000 (09:59 +0200)
commit21990530188ca07e3d1fadda244314fb40b3f4d9
tree349aeab5bf9695523a5bd9e1a88aee602ccbe75e
parentde25313cd8c58f120d52ddb57a26fff5ca4951c6
BUG/MEDIUM: htx: Fix headers rollback on partial copy in htx_xfer()

In htx_xfer() function, when headers are partially copied, depending on the
flags, a rollback may be performed to remove all copied headers from the
destination message. However, there was an issue in the loop performing the
rollback. Instead of decrementing the returned value using the size of the
HTX block from the destination message, the one from the source message was
used. So the wrong value was be returned and in worst case, it could
overflow.

In addition, the BUG_ON() in the loop was removed because test condition was
wrong.

It is a 3.4-specific issue. No backport needed.
src/htx.c