[Pkg-apache-commits] r1161 - in /branches/lenny-apache2: changelog patches/00list patches/078_avoid_brigade_destroy.dpatch

sf at alioth.debian.org sf at alioth.debian.org
Tue Mar 2 20:46:13 UTC 2010


Author: sf
Date: Tue Mar  2 20:46:12 2010
New Revision: 1161

URL: http://svn.debian.org/wsvn/pkg-apache/?sc=1&rev=1161
Log:
Fix potential memory leaks related to the usage of apr_brigade_destroy

Added:
    branches/lenny-apache2/patches/078_avoid_brigade_destroy.dpatch   (with props)
Modified:
    branches/lenny-apache2/changelog
    branches/lenny-apache2/patches/00list

Modified: branches/lenny-apache2/changelog
URL: http://svn.debian.org/wsvn/pkg-apache/branches/lenny-apache2/changelog?rev=1161&op=diff
==============================================================================
--- branches/lenny-apache2/changelog (original)
+++ branches/lenny-apache2/changelog Tue Mar  2 20:46:12 2010
@@ -4,6 +4,7 @@
     mod_proxy_ajp.
   * Add missing psmisc dependency for killall used in the init script.
     Closes: #568542
+  * Fix potential memory leaks related to the usage of apr_brigade_destroy().
 
  -- Stefan Fritsch <sf at debian.org>  Tue, 02 Mar 2010 21:32:45 +0100
 

Modified: branches/lenny-apache2/patches/00list
URL: http://svn.debian.org/wsvn/pkg-apache/branches/lenny-apache2/patches/00list?rev=1161&op=diff
==============================================================================
--- branches/lenny-apache2/patches/00list (original)
+++ branches/lenny-apache2/patches/00list Tue Mar  2 20:46:12 2010
@@ -36,6 +36,7 @@
 075_CVE-2009-3095.dpatch
 076_CVE-2009-3555.dpatch
 077_CVE-2010-0408_mod_proxy_ajp_DoS.dpatch
+078_avoid_brigade_destroy.dpatch
 099_config_guess_sub_update
 200_cp_suexec.dpatch
 201_build_suexec-custom.dpatch

Added: branches/lenny-apache2/patches/078_avoid_brigade_destroy.dpatch
URL: http://svn.debian.org/wsvn/pkg-apache/branches/lenny-apache2/patches/078_avoid_brigade_destroy.dpatch?rev=1161&op=file
==============================================================================
--- branches/lenny-apache2/patches/078_avoid_brigade_destroy.dpatch (added)
+++ branches/lenny-apache2/patches/078_avoid_brigade_destroy.dpatch Tue Mar  2 20:46:12 2010
@@ -1,0 +1,92 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: avoid potential mem leaks
+## DP: adapted from r821477 from upstream svn / will be in 2.2.15
+
+ at DPATCH@
+Index: server/core_filters.c
+===================================================================
+--- a/server/core_filters.c	(Revision 911217)
++++ a/server/core_filters.c	(Arbeitskopie)
+@@ -655,6 +655,8 @@
+                             /* Create a temporary brigade as a means
+                              * of concatenating a bunch of buckets together
+                              */
++                            temp_brig = apr_brigade_create(f->c->pool,
++                                                       f->c->bucket_alloc);
+                             if (last_merged_bucket) {
+                                 /* If we've concatenated together small
+                                  * buckets already in a previous pass,
+@@ -667,16 +669,9 @@
+                                  * these buckets, so that the content
+                                  * in them doesn't have to be copied again.
+                                  */
+-                                apr_bucket_brigade *bb;
+-                                bb = apr_brigade_split(b,
+-                                         APR_BUCKET_NEXT(last_merged_bucket));
+-                                temp_brig = b;
+-                                b = bb;
++                                APR_BRIGADE_PREPEND(b, temp_brig);
++                                brigade_move(temp_brig, b, APR_BUCKET_NEXT(last_merged_bucket));
+                             }
+-                            else {
+-                                temp_brig = apr_brigade_create(f->c->pool,
+-                                                           f->c->bucket_alloc);
+-                            }
+ 
+                             temp = APR_BRIGADE_FIRST(b);
+                             while (temp != e) {
+@@ -879,7 +874,7 @@
+                 logio_add_bytes_out(c, bytes_sent);
+         }
+ 
+-        apr_brigade_destroy(b);
++        apr_brigade_cleanup(b);
+ 
+         /* drive cleanups for resources which were set aside
+          * this may occur before or after termination of the request which
+@@ -910,7 +905,7 @@
+                           "core_output_filter: writing data to the network");
+ 
+             if (more)
+-                apr_brigade_destroy(more);
++                apr_brigade_cleanup(more);
+ 
+             /* No need to check for SUCCESS, we did that above. */
+             if (!APR_STATUS_IS_EAGAIN(rv)) {
+Index: modules/http/byterange_filter.c
+===================================================================
+--- a/modules/http/byterange_filter.c	(Revision 911217)
++++ a/modules/http/byterange_filter.c	(Arbeitskopie)
+@@ -308,7 +308,7 @@
+     APR_BRIGADE_INSERT_TAIL(bsend, e);
+ 
+     /* we're done with the original content - all of our data is in bsend. */
+-    apr_brigade_destroy(bb);
++    apr_brigade_cleanup(bb);
+ 
+     /* send our multipart output */
+     return ap_pass_brigade(f->next, bsend);
+Index: modules/http/http_filters.c
+===================================================================
+--- a/modules/http/http_filters.c	(Revision 911217)
++++ a/modules/http/http_filters.c	(Arbeitskopie)
+@@ -1120,7 +1120,7 @@
+             ctx = f->ctx = apr_pcalloc(r->pool, sizeof(header_filter_ctx));
+         }
+         else if (ctx->headers_sent) {
+-            apr_brigade_destroy(b);
++            apr_brigade_cleanup(b);
+             return OK;
+         }
+     }
+@@ -1291,7 +1291,7 @@
+     ap_pass_brigade(f->next, b2);
+ 
+     if (r->header_only) {
+-        apr_brigade_destroy(b);
++        apr_brigade_cleanup(b);
+         ctx->headers_sent = 1;
+         return OK;
+     }

Propchange: branches/lenny-apache2/patches/078_avoid_brigade_destroy.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-apache-commits mailing list