]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: sample: Adjust sample size capacity after pointer shift for bytes()
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Jul 2026 15:48:47 +0000 (17:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Jul 2026 05:29:50 +0000 (07:29 +0200)
commit980fd3fcc674945eb3a43b146c3e803b98c0cd12
tree9f008abac45d1f3a8ac07775d0a337115d9cd350
parent65d462ba7c1de98bc1aaa2bef4880bcca8344e5f
BUG/MEDIUM: sample: Adjust sample size capacity after pointer shift for bytes()

For the bytes() converter, on success, the area pointer of the sample buffer
is moved forward without updating the buffer size accordingly. If this
converter is followed by another one relying on the buffer size to do some
operations on the buffer area, this could lead to a buffer overflow.

Thanks to Charles Vosburgh <theminershive@gmail.com> for reporting this and
providing the fix.

This patch must be backported to 3.0.
src/sample.c