]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: check: Ignore small-buffer option when starting an external check
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 Jun 2026 16:55:23 +0000 (18:55 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 Jun 2026 17:19:02 +0000 (19:19 +0200)
When an external check is started for a server, there is no tcpcheck
ruleset. The pointer is NULL. It was an issue leading to a crash if the
small-buffer option was enabled on the healthchecks. However, it is
irrelevant for external checks because it is only usefull to tcp checks.

So, the option must be ignored if there is no tcpcheck ruleset.

This patch must be backported to 3.4.

src/check.c

index be979468031ba7add109aee310c1f357950e4de9..f3df19077ed98163426f97f8da379f2e469de5d0 100644 (file)
@@ -1682,7 +1682,7 @@ static int start_checks()
        for (px = proxies_list; px; px = px->next) {
                for (s = px->srv; s; s = s->next) {
                        if ((px->options2 & PR_O2_USE_SBUF_CHECK) &&
-                           (s->check.tcpcheck->rs->flags & TCPCHK_RULES_MAY_USE_SBUF))
+                           (s->check.tcpcheck->rs && s->check.tcpcheck->rs->flags & TCPCHK_RULES_MAY_USE_SBUF))
                                s->check.state |= CHK_ST_USE_SMALL_BUFF;
 
                        if (s->check.state & CHK_ST_CONFIGURED) {