diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-01-05 16:38:49 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-01-05 16:38:49 +0100 |
commit | 29dda184e56ce3a1ec72db4612198f6b3ba84e82 (patch) | |
tree | e85600ecd1de94a9e2ac50a5d712126ff55595af /conf/cf-lex.l | |
parent | 75aceadaf746f8ed0acce0424f89903283dacf16 (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/cf-lex.l')
-rw-r--r-- | conf/cf-lex.l | 2 |
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; |