summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r--src/http/ngx_http_parse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index a45c04554..68f604e10 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -446,6 +446,11 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
case sw_port:
if (ch >= '0' && ch <= '9') {
+ if (r->port >= 6553 && (r->port > 6553 || (ch - '0') > 5)) {
+ return NGX_HTTP_PARSE_INVALID_REQUEST;
+ }
+
+ r->port = r->port * 10 + (ch - '0');
break;
}