BUG/MEDIUM: tcpcheck: Don't eval custom expect rule on an empty buffer
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Apr 2023 12:47:15 +0000 (14:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Apr 2023 13:01:10 +0000 (15:01 +0200)
commit2ebac6a3207188944404f02f2c03ec5bcba16c08
treecf9b6decaae22bfeb9c83d0f081a86928dbab5d7
parent89aeabff5bc99dc96cd1dcb65d7c06a60ea7ac35
BUG/MEDIUM: tcpcheck: Don't eval custom expect rule on an empty buffer

The commit a664aa6a6 ("BUG/MINOR: tcpcheck: Be able to expect an empty
response") instroduced a regression for expect rules relying on a custom
function. Indeed, there is no check on the buffer to be sure it is not empty
before calling the custom function. But some of these functions expect to
have data and don't perform any test on the buffer emptiness.

So instead of fixing all custom functions, we just don't eval them if the
buffer is empty.

This patch must be backported but only if the commit above was backported
first.
src/tcpcheck.c