mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-15 14:21:08 +01:00
BUG/MINOR: lua: bad args are returned for Lua actions
In tcp actions case, the argument n - 1 is returned. For example: http-request lua.script stuff display "stuff" as first arg tcp-request content lua.script stuff display "lua.script" as first arg The action parser doesn't use the *cur_arg value. Thanks to Andy Franks for the bug report. This patch mist be backported in haproxy-1.8 and haproxy-1.9
This commit is contained in:
parent
7778b59be1
commit
1725c2e395
@ -7641,11 +7641,11 @@ static enum act_parse_ret action_register_lua(const char **args, int *cur_arg, s
|
||||
|
||||
/* Expect some arguments */
|
||||
for (i = 0; i < fcn->nargs; i++) {
|
||||
if (*args[i+1] == '\0') {
|
||||
if (*args[*cur_arg] == '\0') {
|
||||
memprintf(err, "expect %d arguments", fcn->nargs);
|
||||
return ACT_RET_PRS_ERR;
|
||||
}
|
||||
rule->arg.hlua_rule->args[i] = strdup(args[i + 1]);
|
||||
rule->arg.hlua_rule->args[i] = strdup(args[*cur_arg]);
|
||||
if (!rule->arg.hlua_rule->args[i]) {
|
||||
memprintf(err, "out of memory error");
|
||||
return ACT_RET_PRS_ERR;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user