mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-10 16:00:08 +00:00
BUG/MAJOR: acl: add implicit arguments to the resolve list
When an ACL keyword needs a mandatory argument and this argument is of type proxy or table, it is allowed not to specify it so that current proxy is used by default. In order to achieve this, the ACL expression parser builds a dummy argument from scratch and marks it unresolved. However, since recent changes on the ACL and samples, an unresolved argument needs to be added to the unresolved list. This specific code did not do it, resulting in random data being used as a proxy pointer if no argument was passed for a proxy name, possibly even causing a crash. A quick workaround consists explicitly naming proxies in ACLs.
This commit is contained in:
parent
4fc90efed0
commit
f75d008c45
@ -1135,6 +1135,8 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
|
|||||||
expr->args[0].data.str.str = strdup("");
|
expr->args[0].data.str.str = strdup("");
|
||||||
expr->args[0].data.str.len = 1;
|
expr->args[0].data.str.len = 1;
|
||||||
expr->args[0].data.str.len = 0;
|
expr->args[0].data.str.len = 0;
|
||||||
|
arg_list_add(al, &expr->args[0], 0);
|
||||||
|
|
||||||
expr->args[1].type = ARGT_STOP;
|
expr->args[1].type = ARGT_STOP;
|
||||||
}
|
}
|
||||||
else if (ARGM(expr->smp->arg_mask)) {
|
else if (ARGM(expr->smp->arg_mask)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user