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