mirror of
https://github.com/nginx/nginx.git
synced 2026-06-26 11:52:00 +00:00
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.
This commit is contained in:
parent
92f0126269
commit
eb3fed9338
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue