From: Willy Tarreau Date: Tue, 15 Sep 2026 14:37:58 +0000 (+0200) Subject: BUG/MINOR: cfgparse-global: reject extra arguments to numa-cpu-mapping and anonkey X-Git-Tag: v3.5-dev9~162 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=ab58e04582de3cb24a5a1871299a4d72e79378eb;p=haproxy.git BUG/MINOR: cfgparse-global: reject extra arguments to numa-cpu-mapping and anonkey Both keywords silently ignored anything passed after their expected argument, contrary to all the other keywords of the section which properly check for extra args. Let's just fix this. This must NOT be backported since it makes the config parser stricter. --- diff --git a/src/cfgparse-global.c b/src/cfgparse-global.c index 1d2146692..1587c26bc 100644 --- a/src/cfgparse-global.c +++ b/src/cfgparse-global.c @@ -832,11 +832,15 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) global.tune.options &= ~GTUNE_STRICT_LIMITS; } else if (strcmp(args[0], "numa-cpu-mapping") == 0) { + if (alertif_too_many_args(0, file, linenum, args, &err_code)) + goto out; global.numa_cpu_mapping = (kwm == KWM_NO) ? 0 : 1; } else if (strcmp(args[0], "anonkey") == 0) { long long tmp = 0; + if (alertif_too_many_args(1, file, linenum, args, &err_code)) + goto out; if (*args[1] == 0) { ha_alert("parsing [%s:%d]: a key is expected after '%s'.\n", file, linenum, args[0]);