mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
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.
This commit is contained in:
parent
2a83e5fa6d
commit
66be8c6608
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user