BUG/MINOR: arg: fix again incorrect argument length check

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 Jrme for reporting this.

No backport is needed.
This commit is contained in:
Willy Tarreau 2020-02-16 10:46:37 +01:00
parent 6328b73d28
commit 9af749b43e

View File

@ -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;