mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
BUG/MINOR: cfgparse-global: fix allowed args number for setenv
Keywords setenv and presetenv take 2 arguments: variable name and value.
So, the total number, that should be passed to alertif_too_many_args is 2
("setenv <name> <value>") instead of 3. For alertif_too_many_args the first
argument index is 0.
This should be backported in all stable versions.
This commit is contained in:
parent
273d322b6f
commit
df68f7ec96
1 changed files with 1 additions and 1 deletions
|
|
@ -798,7 +798,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
|
|||
#endif /* ! USE_CPU_AFFINITY */
|
||||
}
|
||||
else if (strcmp(args[0], "setenv") == 0 || strcmp(args[0], "presetenv") == 0) {
|
||||
if (alertif_too_many_args(3, file, linenum, args, &err_code))
|
||||
if (alertif_too_many_args(2, file, linenum, args, &err_code))
|
||||
goto out;
|
||||
|
||||
if (*(args[2]) == 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue