]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: arg: fix again incorrect argument length check
authorWilly Tarreau <w@1wt.eu>
Sun, 16 Feb 2020 09:46:37 +0000 (10:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 16 Feb 2020 09:49:55 +0000 (10:49 +0100)
Recent commit 807aef8a14 ("BUG/MINOR: arg: report an error if an argument
is larger than bufsize") aimed at fixing the argument length check but
relied on the fact that the end of string was not reached, except that
it forgot to consider the delimiters (comma and parenthesis) which are
valid conditions to break out of the loop. This used to break simple
expressions like "hdr(xff,1)". Thanks to Jérôme for reporting this.

No backport is needed.

src/arg.c

index dffbb2efe9ec63a760a2150fcb79de11fcce2d90..90742265cc477ac06cb6d01d24241b2ca9246420 100644 (file)
--- a/src/arg.c
+++ b/src/arg.c
@@ -214,7 +214,7 @@ int make_arg_list(const char *in, int len, uint64_t mask, struct arg **argp,
                        trash.data = out - trash.area;
                }
 
-               if (len && *in)
+               if (len && *in && *in != ',' && *in != ')')
                        goto buffer_err;
 
                trash.area[trash.data] = 0;