41a6c3
--- a/modules/filters/mod_deflate.c	2014/02/26 15:24:07	1572091
41a6c3
+++ b/modules/filters/mod_deflate.c	2014/02/26 15:30:25	1572092
41a6c3
@@ -1125,7 +1125,8 @@
41a6c3
                     }
41a6c3
                     ctx->stream.next_in += 4;
41a6c3
                     compLen = getLong(ctx->stream.next_in);
41a6c3
-                    if (ctx->stream.total_out != compLen) {
41a6c3
+                    /* gzip stores original size only as 4 byte value */
41a6c3
+                    if ((ctx->stream.total_out & 0xFFFFFFFF) != compLen) {
41a6c3
                         inflateEnd(&ctx->stream);
41a6c3
                         ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01395)
41a6c3
                                       "Zlib: Length %ld of inflated data does "
41a6c3
@@ -1322,7 +1323,8 @@
41a6c3
                 }
41a6c3
                 ctx->validation_buffer += VALIDATION_SIZE / 2;
41a6c3
                 compLen = getLong(ctx->validation_buffer);
41a6c3
-                if (ctx->stream.total_out != compLen) {
41a6c3
+                /* gzip stores original size only as 4 byte value */
41a6c3
+                if ((ctx->stream.total_out & 0xFFFFFFFF) != compLen) {
41a6c3
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01400)
41a6c3
                                   "Zlib: Length of inflated stream invalid");
41a6c3
                     return APR_EGENERAL;