Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rfc1918ClassBPrivateSpec incorrect matches #795

Closed
improved-broccoli opened this issue Aug 13, 2020 · 1 comment · Fixed by #796
Closed

Rfc1918ClassBPrivateSpec incorrect matches #795

improved-broccoli opened this issue Aug 13, 2020 · 1 comment · Fixed by #796
Labels

Comments

@improved-broccoli
Copy link

Rfc1918ClassBPrivateSpec matches IPs out of RFC range.
For example, 172.222.171.197 will match.
This is caused by a missing escaping backslash before the latest dot in the regex.
Actually, the regex is ^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31).+, the latest dot is considered as a wildcard character because not escaped, so any IP with a second digit starting with characters 15 to 31 will match.

Adding a backslash before, solve the issue: ^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\.+

Here is a scastie to test: https://scastie.scala-lang.org/ktfISeSZQNG9iLt7MvUg0g

May I send a PR?

Thanks.

@fthomas
Copy link
Owner

fthomas commented Aug 13, 2020

Thanks for the report, @jbenoit2011! A PR would be very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants