comparison src/http/ngx_http_request.c @ 3287:e07630a9547d

fix segfault if there is single large_client_header_buffers and a request line fills it completely
author Igor Sysoev <igor@sysoev.ru>
date Tue, 03 Nov 2009 18:12:20 +0000
parents 1e1e66ef3a40
children 63fafb988446
comparison
equal deleted inserted replaced
3286:7c80f584c3a9 3287:e07630a9547d
952 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); 952 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
953 return; 953 return;
954 } 954 }
955 955
956 if (rv == NGX_DECLINED) { 956 if (rv == NGX_DECLINED) {
957 len = r->header_in->end - r->header_name_start;
958 p = r->header_name_start; 957 p = r->header_name_start;
958
959 if (p == NULL) {
960 ngx_log_error(NGX_LOG_INFO, c->log, 0,
961 "client sent too large request");
962 ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
963 return;
964 }
965
966 len = r->header_in->end - p;
959 967
960 if (len > NGX_MAX_ERROR_STR - 300) { 968 if (len > NGX_MAX_ERROR_STR - 300) {
961 len = NGX_MAX_ERROR_STR - 300; 969 len = NGX_MAX_ERROR_STR - 300;
962 p[len++] = '.'; p[len++] = '.'; p[len++] = '.'; 970 p[len++] = '.'; p[len++] = '.'; p[len++] = '.';
963 } 971 }