fix segfault if there is single large_client_header_buffers
and a request line fills it completely
This commit is contained in:
parent
c8312b7e09
commit
2f387509eb
1 changed files with 9 additions and 1 deletions
|
@ -954,9 +954,17 @@ ngx_http_process_request_headers(ngx_event_t *rev)
|
|||
}
|
||||
|
||||
if (rv == NGX_DECLINED) {
|
||||
len = r->header_in->end - r->header_name_start;
|
||||
p = r->header_name_start;
|
||||
|
||||
if (p == NULL) {
|
||||
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
||||
"client sent too large request");
|
||||
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
|
||||
len = r->header_in->end - p;
|
||||
|
||||
if (len > NGX_MAX_ERROR_STR - 300) {
|
||||
len = NGX_MAX_ERROR_STR - 300;
|
||||
p[len++] = '.'; p[len++] = '.'; p[len++] = '.';
|
||||
|
|
Loading…
Reference in a new issue