components/apr-util/patches/CVE-2010-1623.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 13 Jun 2012 10:03:34 -0700
changeset 867 181d993d52cf
parent 203 887f23af6934
permissions -rw-r--r--
7164255 bzip2 needs TPNO and license file modifications 7176373 tcsh needs TPNO and license file modifications

--- buckets/apr_brigade.c	2010/10/01 11:42:57	1003493
+++ buckets/apr_brigade.c	2010/10/01 11:43:26	1003494
@@ -331,7 +331,18 @@
             return APR_SUCCESS;
         }
         APR_BUCKET_REMOVE(e);
-        APR_BRIGADE_INSERT_TAIL(bbOut, e);
+        if (APR_BUCKET_IS_METADATA(e) || len > APR_BUCKET_BUFF_SIZE/4) {
+            APR_BRIGADE_INSERT_TAIL(bbOut, e);
+        }
+        else {
+            if (len > 0) {
+                rv = apr_brigade_write(bbOut, NULL, NULL, str, len);
+                if (rv != APR_SUCCESS) {
+                    return rv;
+                }
+            }
+            apr_bucket_destroy(e);
+        }
         readbytes += len;
         /* We didn't find an APR_ASCII_LF within the maximum line length. */
         if (readbytes >= maxbytes) {