From e60093fcac3642c71447200ee6cfee70e617363a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9Frul=20Topuz?= Date: Fri, 26 Jun 2020 22:12:00 +0300 Subject: [PATCH] purge report calloc fix Report template has not cache file path but it's length is use in buffer memory allocation --- ngx_cache_purge_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ngx_cache_purge_module.c b/ngx_cache_purge_module.c index 08a2710..0ca36bc 100644 --- a/ngx_cache_purge_module.c +++ b/ngx_cache_purge_module.c @@ -1531,7 +1531,7 @@ ngx_http_cache_purge_send_response(ngx_http_request_t *r) { r->headers_out.content_type.len = resp_ct_size - 1; r->headers_out.content_type.data = (u_char *) resp_ct; - resp_tmpl_len = body_len + key[0].len + r->cache->file.name.len ; + resp_tmpl_len = body_len + key[0].len ; buf = ngx_pcalloc(r->pool, resp_tmpl_len); if (buf == NULL) { @@ -1543,7 +1543,7 @@ ngx_http_cache_purge_send_response(ngx_http_request_t *r) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } - len = body_len + key[0].len + r->cache->file.name.len; + len = body_len + key[0].len; r->headers_out.status = NGX_HTTP_OK; r->headers_out.content_length_n = len;