Welcome! Log In Create A New Profile

Advanced

[nginx] FastCGI: f->split_parts reset on request start.

Maxim Dounin
March 17, 2014 07:38AM
details: http://hg.nginx.org/nginx/rev/22d485944c20
branches:
changeset: 5604:22d485944c20
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Mar 17 15:34:36 2014 +0400
description:
FastCGI: f->split_parts reset on request start.

Additionally, make sure to check for errors from ngx_http_parse_header_line()
call after joining saved parts. There shouldn't be any errors, though
check may help to catch bugs like missing f->split_parts reset.

Reported by Lucas Molas.

diffstat:

src/http/modules/ngx_http_fastcgi_module.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diffs (28 lines):

diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1208,6 +1208,10 @@ ngx_http_fastcgi_reinit_request(ngx_http
f->fastcgi_stdout = 0;
f->large_stderr = 0;

+ if (f->split_parts) {
+ f->split_parts->nelts = 0;
+ }
+
r->state = 0;

return NGX_OK;
@@ -1488,6 +1492,13 @@ ngx_http_fastcgi_process_header(ngx_http

rc = ngx_http_parse_header_line(r, &buf, 1);

+ if (rc != NGX_OK) {
+ ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+ "invalid header after joining "
+ "FastCGI records");
+ return NGX_ERROR;
+ }
+
h->key.len = r->header_name_end - r->header_name_start;
h->key.data = r->header_name_start;
h->key.data[h->key.len] = '\0';

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

[nginx] FastCGI: f->split_parts reset on request start.

Maxim Dounin 701 March 17, 2014 07:38AM



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

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready