Mercurial > hg > nginx
comparison src/core/ngx_inet.c @ 6533:b358d670c654
Core: fixed port handling in ngx_parse_inet6_url().
This fixes buffer over-read when no port is specified in cases
similar to 5df5d7d771f6, and catches missing port separator.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Wed, 11 May 2016 17:55:20 +0300 |
parents | 7640d6c213e1 |
children | 19a54ba76c04 |
comparison
equal
deleted
inserted
replaced
6532:2f98b5709d79 | 6533:b358d670c654 |
---|---|
859 u->uri.data = uri; | 859 u->uri.data = uri; |
860 | 860 |
861 last = uri; | 861 last = uri; |
862 } | 862 } |
863 | 863 |
864 if (*port == ':') { | 864 if (port < last) { |
865 if (*port != ':') { | |
866 u->err = "invalid host"; | |
867 return NGX_ERROR; | |
868 } | |
869 | |
865 port++; | 870 port++; |
866 | 871 |
867 len = last - port; | 872 len = last - port; |
868 | 873 |
869 n = ngx_atoi(port, len); | 874 n = ngx_atoi(port, len); |