summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-10-08 17:16:04 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-10-08 17:16:04 +0400
commite875df1842c901c8bf98c00299e645afdb0387e9 (patch)
tree7691ae7f81a77e15ea78492c9e3a9ba36f35891f
parent662ae6da6ba7ca43c5efe3feda5ec04f50d52070 (diff)
downloadnginx-e875df1842c901c8bf98c00299e645afdb0387e9.tar.gz
nginx-e875df1842c901c8bf98c00299e645afdb0387e9.tar.bz2
Fixed possible buffer overrun in "too long header line" logging.
Additionally, ellipsis now always added to make it clear that the header logged is incomplete. Reported by Daniil Bondarev.
-rw-r--r--src/http/ngx_http_request.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 845ada322..560c5f512 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1227,12 +1227,11 @@ ngx_http_process_request_headers(ngx_event_t *rev)
if (len > NGX_MAX_ERROR_STR - 300) {
len = NGX_MAX_ERROR_STR - 300;
- p[len++] = '.'; p[len++] = '.'; p[len++] = '.';
}
ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent too long header line: \"%*s\"",
- len, r->header_name_start);
+ "client sent too long header line: \"%*s...\"",
+ len, r->header_name_start);
ngx_http_finalize_request(r,
NGX_HTTP_REQUEST_HEADER_TOO_LARGE);