diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2013-02-10 03:52:26 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-02-10 03:52:26 +0000 |
commit | ad72db49c01a9b7bfa16199c7e4760000286790d (patch) | |
tree | d98fec715e6b97bdd3f151a269f868d6a86c1a92 | |
parent | 244b6659ec7bff5e85814ab8be272ebe47ef24b8 (diff) | |
download | nginx-ad72db49c01a9b7bfa16199c7e4760000286790d.tar.gz |
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.
-rw-r--r-- | src/http/modules/ngx_http_gzip_filter_module.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c index 128d3d9c8..964f4fd27 100644 --- 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_request_t *r, ngx_http_gzip_ctx_t *ctx) wbits--; memlevel--; } + + if (memlevel < 1) { + memlevel = 1; + } } ctx->wbits = wbits; |