[nginx] svn commit: r4966 - trunk/src/http/modules

vbart at nginx.com vbart at nginx.com
Fri Dec 14 15:17:58 UTC 2012


Author: vbart
Date: 2012-12-14 15:17:58 +0000 (Fri, 14 Dec 2012)
New Revision: 4966
URL: http://trac.nginx.org/nginx/changeset/4966/nginx

Log:
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.



Modified:
   trunk/src/http/modules/ngx_http_gzip_filter_module.c

Modified: trunk/src/http/modules/ngx_http_gzip_filter_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_gzip_filter_module.c	2012-12-13 16:05:59 UTC (rev 4965)
+++ trunk/src/http/modules/ngx_http_gzip_filter_module.c	2012-12-14 15:17:58 UTC (rev 4966)
@@ -498,6 +498,10 @@
             wbits--;
             memlevel--;
         }
+
+        if (memlevel < 1) {
+            memlevel = 1;
+        }
     }
 
     ctx->wbits = wbits;



More information about the nginx-devel mailing list