]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acl: fix improper string size assignment in proxy argument
authorWilly Tarreau <w@1wt.eu>
Sun, 29 Sep 2013 09:36:53 +0000 (11:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 29 Sep 2013 10:54:58 +0000 (12:54 +0200)
This minor bug was found using the coccinelle script "da.cocci". The
len was initialized twice instead of setting the size. It's harmless
since no operations are performed on this empty string but needs to
be fixed anyway.

src/acl.c

index d9475916e6e833f9bd514250cf7f619cfbfe8783..b6e55ec2628d745a5f851c3e06bb13d0cecf132c 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -1158,7 +1158,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
                        expr->args[0].type = type;
                        expr->args[0].unresolved = 1;
                        expr->args[0].data.str.str = strdup("");
-                       expr->args[0].data.str.len = 1;
+                       expr->args[0].data.str.size = 1;
                        expr->args[0].data.str.len = 0;
                        arg_list_add(al, &expr->args[0], 0);