aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/ngx_inet.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c
index 33b303dd0..d5b7cf96a 100644
--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -861,7 +861,12 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
last = uri;
}
- if (*port == ':') {
+ if (port < last) {
+ if (*port != ':') {
+ u->err = "invalid host";
+ return NGX_ERROR;
+ }
+
port++;
len = last - port;