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

For the ltrim() 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 all supported versions.
src/sample.c