mirror of
https://github.com/nginx/nginx.git
synced 2025-06-15 15:40:38 +08:00
merge r3945:
fix segfault if cache key is larger than upstream buffer size patch by Lanshun Zhou
This commit is contained in:
parent
97bf815054
commit
e0ec6a04f5
@ -620,6 +620,15 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
|
|
||||||
ngx_http_file_cache_create_key(r);
|
ngx_http_file_cache_create_key(r);
|
||||||
|
|
||||||
|
if (c->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;
|
||||||
|
}
|
||||||
|
|
||||||
u->cacheable = 1;
|
u->cacheable = 1;
|
||||||
|
|
||||||
c->min_uses = u->conf->cache_min_uses;
|
c->min_uses = u->conf->cache_min_uses;
|
||||||
|
Loading…
Reference in New Issue
Block a user