summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2022-01-05 16:38:49 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2022-01-05 16:38:49 +0100
commit29dda184e56ce3a1ec72db4612198f6b3ba84e82 (patch)
treee85600ecd1de94a9e2ac50a5d712126ff55595af /conf
parent75aceadaf746f8ed0acce0424f89903283dacf16 (diff)
Conf: Fix parsing full-length IPv6 addresses
Lexer expression for bytestring was too loose, accepting also full-length IPv6 addresses. It should be restricted such that colon is used between every byte or never. Fix the regex and also add some test cases for it. Thanks to Alexander Zubkov for the bugreport
Diffstat (limited to 'conf')
-rw-r--r--conf/cf-lex.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index 704a1750..c9d2f5a5 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -255,7 +255,7 @@ WHITE [ \t]
return IP4;
}
-{XIGIT}{2}(:{XIGIT}{2}|{XIGIT}{2}){15,} {
+{XIGIT}{2}((:{XIGIT}{2}){15,}|({XIGIT}{2}){15,}) {
char *s = yytext;
size_t len = 0, i;
struct bytestring *bytes;