comparison src/http/ngx_http_header_filter_module.c @ 4637:668ab1a21327

Zero padded the returned and logged HTTP status code, and fixed possible buffer overrun in $status handling.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 16 May 2012 13:27:04 +0000
parents d11f86a16e3b
children 4c415af7dbc2
comparison
equal deleted inserted replaced
4636:ed957e0daeb4 4637:668ab1a21327
443 /* status line */ 443 /* status line */
444 if (status_line) { 444 if (status_line) {
445 b->last = ngx_copy(b->last, status_line->data, status_line->len); 445 b->last = ngx_copy(b->last, status_line->data, status_line->len);
446 446
447 } else { 447 } else {
448 b->last = ngx_sprintf(b->last, "%ui", status); 448 b->last = ngx_sprintf(b->last, "%03ui", status);
449 } 449 }
450 *b->last++ = CR; *b->last++ = LF; 450 *b->last++ = CR; *b->last++ = LF;
451 451
452 if (r->headers_out.server == NULL) { 452 if (r->headers_out.server == NULL) {
453 if (clcf->server_tokens) { 453 if (clcf->server_tokens) {