]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
core: Do not over allocate memory within 'ap_rgetline_core' for the common case.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 22 Dec 2016 20:45:31 +0000 (20:45 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 22 Dec 2016 20:45:31 +0000 (20:45 +0000)
trunk patch: http://svn.apache.org/r1483005
Submitted by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x-merge-http-strict@1775730 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/protocol.c

diff --git a/CHANGES b/CHANGES
index bd8b050ffe2ed5f19c540573635e0ed77b2f36e0..8b418e91198a18e4929a6071cf9adbc164983ccc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,9 @@ Changes with Apache 2.2.31
   *) Correct win32 build issues for mod_proxy exports, OpenSSL 1.0.x headers.
      [Yann Ylavic, Gregg Smith]
 
+  *) core: Do not over allocate memory within 'ap_rgetline_core' for
+     the common case. [Christophe Jaillet]
+
 Changes with Apache 2.2.30 (not released)
 
   *) SECURITY: CVE-2015-3183 (cve.mitre.org)
index 41fbbb765fa7d362042fada2484aeb6df1313d16..614d501a0b9ef13312a095e2454b615762e8f118 100644 (file)
@@ -183,9 +183,6 @@ AP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime)
     return (mtime > now) ? now : mtime;
 }
 
-/* Min # of bytes to allocate when reading a request line */
-#define MIN_LINE_ALLOC 80
-
 /* Get a line of protocol input, including any continuation lines
  * caused by MIME folding (or broken clients) if fold != 0, and place it
  * in the buffer s, of size n bytes, without the ending newline.
@@ -284,9 +281,6 @@ AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n,
                 /* We'll assume the common case where one bucket is enough. */
                 if (!*s) {
                     current_alloc = len;
-                    if (current_alloc < MIN_LINE_ALLOC) {
-                        current_alloc = MIN_LINE_ALLOC;
-                    }
                     *s = apr_palloc(r->pool, current_alloc);
                 }
                 else if (bytes_handled + len > current_alloc) {