mirror of
https://github.com/nginx/nginx.git
synced 2026-10-24 04:52:25 +00:00
fix segfault if cache key is larger than upstream buffer size
patch by Lanshun Zhou
This commit is contained in:
parent
82afb9cc86
commit
6c3c3bbe42
1 changed files with 9 additions and 0 deletions
|
|
@ -661,6 +661,15 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||
|
||||
ngx_http_file_cache_create_key(r);
|
||||
|
||||
if (r->cache->header_start >= u->conf->buffer_size) {
|
||||
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||
"cache key too large, increase upstream buffer size %uz",
|
||||
u->conf->buffer_size);
|
||||
|
||||
r->cache = NULL;
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
switch (ngx_http_test_predicates(r, u->conf->cache_bypass)) {
|
||||
|
||||
case NGX_ERROR:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue