merge r3945:

fix segfault if cache key is larger than upstream buffer size
patch by Lanshun Zhou
This commit is contained in:
Igor Sysoev 2011-07-19 13:52:56 +00:00
parent 71c6832995
commit 5a80933ea0

View File

@ -666,6 +666,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;
}
u->cacheable = 1;
c = r->cache;