# HG changeset patch # User Maxim Dounin # Date 1360468346 0 # Node ID 63a6b6d708268a22857417f992d093e32d9182c9 # Parent 48d1606107d44e721f7a7f1246def67b97e64023 Merge of r4966: gzip: fixed zlib memLevel adjusting. An incorrect memLevel (lower than 1) might be passed to deflateInit2() if the "gzip_hash" directive is set to a value less than the value of "gzip_window" directive. This resulted in "deflateInit2() failed: -2" alert and an empty reply. diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c --- a/src/http/modules/ngx_http_gzip_filter_module.c +++ b/src/http/modules/ngx_http_gzip_filter_module.c @@ -497,6 +497,10 @@ ngx_http_gzip_filter_memory(ngx_http_req wbits--; memlevel--; } + + if (memlevel < 1) { + memlevel = 1; + } } ctx->wbits = wbits;