]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: cfgparse-global: add missing gotos to error label in max-spread-checks
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Sep 2026 14:37:58 +0000 (16:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2026 07:22:33 +0000 (09:22 +0200)
The three error paths of the parse_time_err() call in the
"max-spread-checks" keyword only set the error code without leaving the
block, so that global.max_spread_checks was assigned an uninitialized
value right after the error was reported. No impact but clearly what
could report a build warning or a report from a static analyser. Let's
just add the missing gotos like everywhere else.

This may be backported to all supported versions.

src/cfgparse-global.c

index b489c533a7e0713d520c66e0d4f8e2007d191646..0e8624de0eb47fbd59d623672a38e91bb9fb4f2c 100644 (file)
@@ -703,15 +703,18 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                        ha_alert("parsing [%s:%d]: timer overflow in argument <%s> to <%s>, maximum value is 2147483647 ms (~24.8 days).\n",
                                 file, linenum, args[1], args[0]);
                        err_code |= ERR_ALERT | ERR_FATAL;
+                       goto out;
                }
                else if (err == PARSE_TIME_UNDER) {
                        ha_alert("parsing [%s:%d]: timer underflow in argument <%s> to <%s>, minimum non-null value is 1 ms.\n",
                                 file, linenum, args[1], args[0]);
                        err_code |= ERR_ALERT | ERR_FATAL;
+                       goto out;
                }
                else if (err) {
                        ha_alert("parsing [%s:%d]: unsupported character '%c' in '%s' (wants an integer delay).\n", file, linenum, *err, args[0]);
                        err_code |= ERR_ALERT | ERR_FATAL;
+                       goto out;
                }
                global.max_spread_checks = val;
        }