]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: sample: Fix bytes() when length it greater than remaining data
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Jul 2026 16:05:14 +0000 (18:05 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Jul 2026 05:29:50 +0000 (07:29 +0200)
commit9a15d207c4d14750aa9e305c1f49eac051c26dc4
treea1f30ca0c9f084cd3d0b50cc7c878010427e84fd
parent7710a897eb2e65334494d92b54daaab96cee5a99
BUG/MINOR: sample: Fix bytes() when length it greater than remaining data

For bytes() converter, when the length parameter is greater than the
remaining data, no truncation on length must be performed. However, in that
case, nothing was performed at all. The changes because of the offset
parameter was just ignored.

Now, when the length value is too large, the sample data are moved
accordingly to the offset value as expected.

The coresponding reg-test was updated to test this case with a non-zero
offset. In addition the documentation was fixed to properly match what the
converter do. It was wrongly updated when the support of variables was
introduced in 2.9.

This patch must be backported as far as 3.0.
doc/configuration.txt
reg-tests/converter/bytes.vtc
src/sample.c