From: Willy Tarreau Date: Sun, 7 Apr 2013 19:20:44 +0000 (+0200) Subject: BUG/MAJOR: acl: add implicit arguments to the resolve list X-Git-Tag: v1.5-dev19~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f75d008c45c6e0e989825d381222cd3d978b01c8;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/acl.c b/src/acl.c index efd1ee662d..6a23bae861 100644 --- 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)) {