wether there is a bug to parse ipv6 url or not?

Maxim Dounin mdounin at mdounin.ru
Thu Feb 17 18:11:22 MSK 2011


Hello!

On Thu, Feb 17, 2011 at 03:01:57AM -0500, garry.lgr wrote:

> I'm reading the nginx0.9.1 source code. 
> now I find a bug when I read the "ngx_parse_inet6_url" function at 914
> line in ngx_inet.c. 
> the code don't correctly get the length of port when parsing the url.
> for example:
>     the ipv6 url is :  "[::FFFF:129.144.52.38]:8080/index.html"

[...]

>         if (*port == ':') {
>             port++;
> 
>             [color=#FF0033]len = last - port; //here......... last is
> the end of url ,but not the position of 8080 [/color]
>             ......
> "

Yes, thank you, looks like a bug.

This shouldn't affect any current usage of ngx_parse_inet6_url() 
though, as IPv6 is only supported in listen directive, which 
shouldn't contain uri part anyway (and ngx_parse_inet6_url() will 
complain correctly about "invalid host" if uri part present for 
listen addresses).

Maxim Dounin



More information about the nginx mailing list