]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: applet: Fix transfer of HTX data to the applet
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 May 2026 13:34:43 +0000 (15:34 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 May 2026 14:21:02 +0000 (16:21 +0200)
commit2a876290528ef8a71401dc51778527ef59266de7
tree013d4e1d91dc907524b64752641107dfa720407d
parent56e7f8ef3189b448d39bccf4ce0612ff8ce76235
BUG/MEDIUM: applet: Fix transfer of HTX data to the applet

appctx_htx_snd_buf() function is relying on htx_xfer() function to transfer
HTX blocks when a swap of buffers is not possible. However, it was not
properly using this function.

Indeed, originally htx_xfer() was designed to transfer blocks with a limit,
the <count> parameter, which included the blocks payload and the
meta-data. It was aligned with all calls, except for the transfer of HTX
data to the applet, in appctx_htx_snd_buf() function. In that case, the
<count> parameter is the amount of data forwarded by the stream to the
applet. So meta-data are not included.

Thanks to the previous commit ("MEDIUM: htx: Improve htx_xfer API to not count
HTX meta-data"), it is now possible to instruct htx_xfer() function that
<count> parameter does not include the meta-data.

Because of this bug, crashes can be experienced when transferring HTX data
to an applet. At first glance, lua HTTP applets and the http client are
concerned.

Stable versions from 3.3 to 3.0 are also affected. But this patch cannot be
backported as is because htx_xfer() function does not exist on these
versions.

Thaks to Yon Harlicaj for finding and reporting this.
(https://x.com/nvmb3r - https://www.linkedin.com/in/eljon-harlicaj/)
src/applet.c