Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4638 - in trunk/src/http: . modules

Anonymous User
May 16, 2012 09:28AM
Author: ru
Date: 2012-05-16 13:27:04 +0000 (Wed, 16 May 2012)
New Revision: 4638
URL: http://trac.nginx.org/nginx/changeset/4638/nginx

Log:
Zero padded the returned and logged HTTP status code, and fixed possible
buffer overrun in $status handling.


Modified:
trunk/src/http/modules/ngx_http_log_module.c
trunk/src/http/ngx_http_header_filter_module.c

Modified: trunk/src/http/modules/ngx_http_log_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_log_module.c 2012-05-16 13:22:03 UTC (rev 4637)
+++ trunk/src/http/modules/ngx_http_log_module.c 2012-05-16 13:27:04 UTC (rev 4638)
@@ -205,7 +205,7 @@
{ 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 @@
status = 0;
}

- return ngx_sprintf(buf, "%ui", status);
+ return ngx_sprintf(buf, "%03ui", status);
}



Modified: trunk/src/http/ngx_http_header_filter_module.c
===================================================================
--- trunk/src/http/ngx_http_header_filter_module.c 2012-05-16 13:22:03 UTC (rev 4637)
+++ trunk/src/http/ngx_http_header_filter_module.c 2012-05-16 13:27:04 UTC (rev 4638)
@@ -445,7 +445,7 @@
b->last = ngx_copy(b->last, status_line->data, status_line->len);

} else {
- b->last = ngx_sprintf(b->last, "%ui", status);
+ b->last = ngx_sprintf(b->last, "%03ui", status);
}
*b->last++ = CR; *b->last++ = LF;


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4638 - in trunk/src/http: . modules

Anonymous User 1510 May 16, 2012 09:28AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 133
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready