aboutsummaryrefslogtreecommitdiff
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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 0e0b3a237..59aa1fea9 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -737,6 +737,10 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
return NGX_HTTP_PARSE_INVALID_REQUEST;
}
+ if (r->http_major > 99) {
+ return NGX_HTTP_PARSE_INVALID_REQUEST;
+ }
+
r->http_major = r->http_major * 10 + ch - '0';
break;
@@ -770,6 +774,10 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
return NGX_HTTP_PARSE_INVALID_REQUEST;
}
+ if (r->http_minor > 99) {
+ return NGX_HTTP_PARSE_INVALID_REQUEST;
+ }
+
r->http_minor = r->http_minor * 10 + ch - '0';
break;
@@ -1680,6 +1688,10 @@ ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
return NGX_ERROR;
}
+ if (r->http_major > 99) {
+ return NGX_ERROR;
+ }
+
r->http_major = r->http_major * 10 + ch - '0';
break;
@@ -1704,6 +1716,10 @@ ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
return NGX_ERROR;
}
+ if (r->http_minor > 99) {
+ return NGX_ERROR;
+ }
+
r->http_minor = r->http_minor * 10 + ch - '0';
break;