Mercurial > hg > nginx
diff src/http/modules/ngx_http_log_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 | 674227175c4c |
children | 956edecaedeb |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -205,7 +205,7 @@ static ngx_http_log_var_t ngx_http_log_ { ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec }, { ngx_string("request_time"), NGX_TIME_T_LEN + 4, ngx_http_log_request_time }, - { ngx_string("status"), 3, ngx_http_log_status }, + { ngx_string("status"), NGX_INT_T_LEN, ngx_http_log_status }, { ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent }, { ngx_string("body_bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_body_bytes_sent }, @@ -593,7 +593,7 @@ ngx_http_log_status(ngx_http_request_t * status = 0; } - return ngx_sprintf(buf, "%ui", status); + return ngx_sprintf(buf, "%03ui", status); }