diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2013-07-30 11:43:21 +0400 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2013-07-30 11:43:21 +0400 |
commit | eb3fed9338768a152d208cf15f78eb60f2c0b6d2 (patch) | |
tree | d2a8dcc619890c551c3b6be6b0f41f603f9642be /src | |
parent | 92f0126269a4e4faa7c5f459d6a928ac83b5fa9c (diff) | |
download | nginx-eb3fed9338768a152d208cf15f78eb60f2c0b6d2.tar.gz nginx-eb3fed9338768a152d208cf15f78eb60f2c0b6d2.zip |
Autoindex: return NGX_ERROR on error if headers were sent.
This prevents ngx_http_finalize_request() from issuing
ngx_http_special_response_handler() on a freed context.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_autoindex_module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c index e3dcfd07e..e21d8d73e 100644 --- a/src/http/modules/ngx_http_autoindex_module.c +++ b/src/http/modules/ngx_http_autoindex_module.c @@ -388,7 +388,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r) b = ngx_create_temp_buf(r->pool, len); if (b == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; + return NGX_ERROR; } if (entries.nelts > 1) { @@ -649,7 +649,7 @@ ngx_http_autoindex_error(ngx_http_request_t *r, ngx_dir_t *dir, ngx_str_t *name) ngx_close_dir_n " \"%V\" failed", name); } - return NGX_HTTP_INTERNAL_SERVER_ERROR; + return r->header_sent ? NGX_ERROR : NGX_HTTP_INTERNAL_SERVER_ERROR; } |