]> git.kaiwu.me - nginx.git/commitdiff
SPDY: fixed "too long header line" logging.
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 7 Nov 2014 14:38:55 +0000 (17:38 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 7 Nov 2014 14:38:55 +0000 (17:38 +0300)
This fixes possible one byte buffer overrun and makes sure ellipsis are
always added, see 21043ce2a005.

src/http/ngx_http_spdy.c

index 3c57882a6ad84bd2df1ae6155c1eb3cd943d20fd..010b803b385f2a55e59ec0700826b7f90b4e8d13 100644 (file)
@@ -2656,11 +2656,10 @@ ngx_http_spdy_alloc_large_header_buffer(ngx_http_request_t *r)
 
         if (rest > NGX_MAX_ERROR_STR - 300) {
             rest = NGX_MAX_ERROR_STR - 300;
-            p[rest++] = '.'; p[rest++] = '.'; p[rest++] = '.';
         }
 
         ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
-                      "client sent too long header name or value: \"%*s\"",
+                      "client sent too long header name or value: \"%*s...\"",
                       rest, p);
 
         return NGX_DECLINED;