errorfile and errorloc directives expect excatly two arguments. But extra
arguments were just ignored while an error should be emitted. It is now
fixed.
This patch could be backported as far as 2.2 if necessary.
(cherry picked from commit
f578811c4e8965f243cd16a6f569909a2a07498c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
ret = -1;
goto out;
}
+ if (*(args[3])) {
+ memprintf(errmsg, "%s : expects exactly two arguments.\n", args[0]);
+ ret = -1;
+ goto out;
+ }
status = atol(args[1]);
errloc = (strcmp(args[0], "errorloc303") == 0 ? 303 : 302);
ret = -1;
goto out;
}
+ if (*(args[3])) {
+ memprintf(errmsg, "%s : expects exactly two arguments.\n", args[0]);
+ ret = -1;
+ goto out;
+ }
status = atol(args[1]);
msg = http_parse_errorfile(status, args[2], errmsg);