]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tcpchecks: Limit parsing of agent-check reply to the buffer
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 May 2026 13:22:28 +0000 (15:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 May 2026 15:17:01 +0000 (17:17 +0200)
commit57b526e0224cd6523689a0ecd05efd7f28f1edf0
tree64fd6a562aa3e0b744500664866624203d014d60
parent2644f9ddf92975f570788ed7ce5bd585b0e85f28
BUG/MINOR: tcpchecks: Limit parsing of agent-check reply to the buffer

When parsing the agent-check reply, we first loop on the response to find
the newline character, to add a NULL-byte at the end of the line. However,
this loop is not bounded to the data available in the buffer. So it is
possible to read bytes outside the buffer and eventually write a NULL-byte
ouside the buffer.

So let's check for the end of the buffer when looping on the agent-check
reply.

This patch must be backported to all stable versions.
src/tcpcheck.c