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

Don't accept overly long IPv6 numbers #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Don't accept overly long IPv6 numbers #79

wants to merge 1 commit into from

Conversation

WayneD
Copy link

@WayneD WayneD commented Jun 22, 2020

The current code stops parsing a hex number after 4 digits and then loops around to look for punctuation. If none is found, it just starts parsing more hex digits, so it will accept invalid IPv6 such as 1::1234567890abcdef

My simple change makes the code return 0 if a 5th hex digit in a row is found.

The current code stops parsing a hex number after 4 digits and then
loops around to look for punctuation.  If none is found, it just
starts parsing more hex digits, so it will accept invalid IPv6 such
as `1::1234567890abcdef`

My simple tweak makes it return 0 if a 5th digit is found.
@HeikoSchlittermann
Copy link
Member

The string_is_ip_address() is being reworked currently. Thx for your contribution, I'll close this PR as soon as the reworked version hits the public git (master branch and probably even 4.96.1+fixes)

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