Skip to content

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
Development

Successfully merging this pull request may close these issues.

2 participants