]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acl: acl parser does not recognize empty converter list
authorThierry FOURNIER <tfournier@exceliance.fr>
Fri, 6 Dec 2013 09:34:35 +0000 (10:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 Dec 2013 10:32:19 +0000 (11:32 +0100)
Commit 348971e (MEDIUM: acl: use the fetch syntax 'fetch(args),conv(),conv()'
into the ACL keyword) introduced a regression in the ACL parser. The second
argument of an ACL keyword is now mistakenly confused with a converter.

This bug is post-dev19 and does not require any backport.

src/acl.c

index e8d4dc3ece063a72b6190e455298cb6bc6f334b0..95b559c101e5b77afa9ea31b34aa738cee335ad7 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -251,6 +251,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
                                        memprintf(err, "in argument to '%s', %s", expr->kw, *err);
                                        goto out_free_expr;
                                }
+                               arg = end;
                        }
                        else if (ARGM(expr->smp->fetch->arg_mask) == 1) {
                                int type = (expr->smp->fetch->arg_mask >> 4) & 15;
@@ -308,7 +309,10 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
                 */
 
                /* look for the begining of the converters list */
-               arg = strchr(args[0], ',');
+               if (arg)
+                       arg = strchr(arg, ',');
+               else
+                       arg = strchr(args[0], ',');
                if (arg) {
                        prev_type = expr->smp->fetch->out_type;
                        while (1) {