]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: acl: add implicit arguments to the resolve list
authorWilly Tarreau <w@1wt.eu>
Sun, 7 Apr 2013 19:20:44 +0000 (21:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Apr 2013 19:20:44 +0000 (21:20 +0200)
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.

src/acl.c

index efd1ee662d444014b8e1ec0cdc6c8d84cc0149d7..6a23bae8612708f3f9025c69e6f7980c38ef1082 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -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.len = 1;
                        expr->args[0].data.str.len = 0;
+                       arg_list_add(al, &expr->args[0], 0);
+
                        expr->args[1].type = ARGT_STOP;
                }
                else if (ARGM(expr->smp->arg_mask)) {