From c11277b94fda95e32e8d9848457ef2bd91772b30 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 24 Oct 2022 14:37:22 +0200 Subject: conf: Don't pass leading ~ to parse_port_range() on exclusions Commit 84fec4e998b6 ("Clean up parsing of port ranges") drops the strspn() call before the parsing of excluded port ranges, because now we're checking against any stray characters at every step. However, that also has the effect of passing ~ as first character to the new parse_port_range(), which makes no sense: we already checked that ~ is the first character before the call, so skip it. Alona reported this output: Invalid port specifier ~15000,~15001,~15006,~15008,~15020,~15021,~15090 while the whole specifier is indeed valid. Reported-by: Alona Paz Fixes: 84fec4e998b6 ("Clean up parsing of port ranges") Signed-off-by: Stefano Brivio --- conf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'conf.c') diff --git a/conf.c b/conf.c index ed93a60..598c711 100644 --- a/conf.c +++ b/conf.c @@ -262,6 +262,7 @@ static int conf_ports(const struct ctx *c, char optname, const char *optarg, exclude_only = false; continue; } + p++; if (parse_port_range(p, &p, &xrange)) goto bad; -- cgit v1.2.3