[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb updated HTTPCLIENT-1319:
-----------------------------

    Description: 
The IPV6 compressed format regex allows 0 or more hex groups before or after 
the ::.

This does not detect too many groups (there should be at most 7 surrounding 
groups in total).
It also allows no groups, i.e "::" which is not permitted AFAIK. [Edit: this is 
allowed, see 

The first issue could be detected by counting the number of ':' characters in 
the string. 
There should be no more than 7 colons.
The empty group could be detected by checking the length of the string - it 
must be at least 3 characters.
That should probably be tested first as it is relatively cheap.

  was:
The IPV6 compressed format regex allows 0 or more hex groups before or after 
the ::.

This does not detect too many groups (there should be at most 7 surrounding 
groups in total).
It also allows no groups, i.e "::" which is not permitted AFAIK.

The first issue could be detected by counting the number of ':' characters in 
the string. 
There should be no more than 7 colons.
The empty group could be detected by checking the length of the string - it 
must be at least 3 characters.
That should probably be tested first as it is relatively cheap.

    
> InetAddressUtils.isIPv6HexCompressedAddress does not detect excess groups
> -------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1319
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1319
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.3 Alpha1
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 4.3 Final
>
>
> The IPV6 compressed format regex allows 0 or more hex groups before or after 
> the ::.
> This does not detect too many groups (there should be at most 7 surrounding 
> groups in total).
> It also allows no groups, i.e "::" which is not permitted AFAIK. [Edit: this 
> is allowed, see 
> The first issue could be detected by counting the number of ':' characters in 
> the string. 
> There should be no more than 7 colons.
> The empty group could be detected by checking the length of the string - it 
> must be at least 3 characters.
> That should probably be tested first as it is relatively cheap.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to