]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: Set missing id to the dummy checks frontend
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Apr 2021 08:49:07 +0000 (10:49 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Sat, 17 Apr 2021 09:14:58 +0000 (11:14 +0200)
The dummy frontend used to create the session of the tcp-checks is
initialized without identifier. However, it is required because this id may
be used without any guard, for instance in log-format string via "%f" or
when fe_name sample fetch is called. Thus, an unset id may lead to crashes.

This patch must be backported as far as 2.2.

src/check.c

index 4c625efa61cb13f2a64db4fc3b970a026723a385..e3778ea5b9ec8a64efb929c3a93d9a199f8856f9 100644 (file)
@@ -1420,6 +1420,7 @@ static int start_checks()
 
        /* 0- init the dummy frontend used to create all checks sessions */
        init_new_proxy(&checks_fe);
+       checks_fe.id = strdup("CHECKS-FE");
        checks_fe.cap = PR_CAP_FE | PR_CAP_BE;
         checks_fe.mode = PR_MODE_TCP;
        checks_fe.maxconn = 0;