apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1003491 - /apr/apr/trunk/buckets/apr_brigade.c
Date Fri, 01 Oct 2010 11:41:45 GMT
Author: trawick
Date: Fri Oct  1 11:41:44 2010
New Revision: 1003491

URL: http://svn.apache.org/viewvc?rev=1003491&view=rev
Log:
SECURITY: CVE-2010-1623 (cve.mitre.org)
Fix a denial of service attack against apr_brigade_split_line().

Submitted by: sf
Reviewed by: trawick, jorton

Modified:
    apr/apr/trunk/buckets/apr_brigade.c

Modified: apr/apr/trunk/buckets/apr_brigade.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/buckets/apr_brigade.c?rev=1003491&r1=1003490&r2=1003491&view=diff
==============================================================================
--- apr/apr/trunk/buckets/apr_brigade.c (original)
+++ apr/apr/trunk/buckets/apr_brigade.c Fri Oct  1 11:41:44 2010
@@ -347,7 +347,18 @@ APR_DECLARE(apr_status_t) apr_brigade_sp
             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) {



Mime
View raw message