]> granicus.if.org Git - apache/commitdiff
Merge r1572092 from trunk:
authorYann Ylavic <ylavic@apache.org>
Sat, 21 Jun 2014 21:13:45 +0000 (21:13 +0000)
committerYann Ylavic <ylavic@apache.org>
Sat, 21 Jun 2014 21:13:45 +0000 (21:13 +0000)
mod_deflate: fix decompression of files larger than 4GB. According to RFC1952,
Input SIZE (compLen) contains the size of the original input data modulo 2^32.

PR: 56062
Submitted by: Lukas Bezdicka
Reviewed by: jkaluza, ylavic, covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1604460 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/filters/mod_deflate.c

diff --git a/CHANGES b/CHANGES
index bbc00a51cee1ba9183ba1f7aa4957b117a5f5591..2545574852cfc750995ee56a8eb1c6a62e979385 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.10
 
+  *) mod_deflate: Fix inflation of files larger than 4GB. PR 56062.
+     [Lukas Bezdicka <social v3.sk>]
+
   *) mod_deflate: Handle Zlib header and validation bytes received in multiple
      chunks. PR 46146. [Yann Ylavic]
 
diff --git a/STATUS b/STATUS
index ad3539eb1555519b91df47fb36b6ef80f8f85523..24c9936607145e85ec792bf3b5bd35da7dde08d8 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -100,19 +100,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_deflate: Fix decompression of files larger than 4GB. According to RFC1952,
-                  Input SIZE contains the size of the original input data modulo 2^32.
-                  PR 56062.
-     Submitted by: [Lukas Bezdicka <social v3 sk>]
-     Committed by: jkaluza
-     trunk patch: http://svn.apache.org/r1572092
-     2.4.x patch: http://people.apache.org/~ylavic/httpd-2.4.x-mod_deflate_4GB.patch
-                  (modulo CHANGES, added lately from r1603156)
-     2.4.x patch: trunk works
-     +1: ylavic, jkaluza, covener
-     ylavic: does not depend on r1572655 and al or r1572896 and al below,
-             these proposals can be backported in any order.
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index d3efad4b981860668d6da4eba36e81177f8d138d..b8e8fd6e6ea426a4c69778e8c4af0cad595b5783 100644 (file)
@@ -1304,7 +1304,8 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
                         return APR_EGENERAL;
                     }
                     compLen = getLong(buf + VALIDATION_SIZE / 2);
-                    if (ctx->stream.total_out != compLen) {
+                    /* gzip stores original size only as 4 byte value */
+                    if ((ctx->stream.total_out & 0xFFFFFFFF) != compLen) {
                         inflateEnd(&ctx->stream);
                         ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01395)
                                       "Zlib: Length %ld of inflated data does "
@@ -1492,7 +1493,8 @@ static apr_status_t inflate_out_filter(ap_filter_t *f,
                 }
                 ctx->validation_buffer += VALIDATION_SIZE / 2;
                 compLen = getLong(ctx->validation_buffer);
-                if (ctx->stream.total_out != compLen) {
+                /* gzip stores original size only as 4 byte value */
+                if ((ctx->stream.total_out & 0xFFFFFFFF) != compLen) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01400)
                                   "Zlib: Length of inflated stream invalid");
                     return APR_EGENERAL;