aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2012-12-14 15:17:58 +0000
committerValentin Bartenev <vbart@nginx.com>2012-12-14 15:17:58 +0000
commite86279e9f3d06ef50c518551eb6c7aea9d0bd41d (patch)
tree7572d21dc22e07ae99ff2dc899ea0bdd8cc87d3f /src
parent658296290cc1be3739f0092d5afe719df5a88d82 (diff)
downloadnginx-e86279e9f3d06ef50c518551eb6c7aea9d0bd41d.tar.gz
nginx-e86279e9f3d06ef50c518551eb6c7aea9d0bd41d.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_gzip_filter_module.c4
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 09994d9b2..470be3daf 100644
--- a/src/http/modules/ngx_http_gzip_filter_module.c
+++ b/src/http/modules/ngx_http_gzip_filter_module.c
@@ -498,6 +498,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;