]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* modules/proxy/mod_proxy_fcgi.c (dispatch): Only allocate a heap
authorJoe Orton <jorton@apache.org>
Wed, 8 May 2024 12:44:52 +0000 (12:44 +0000)
committerJoe Orton <jorton@apache.org>
Wed, 8 May 2024 12:44:52 +0000 (12:44 +0000)
  buffer if the configured size is greater than the stack-allocated
  buffer.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1917576 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_fcgi.c

index d420df6a77a507c3ded5b65e22537d1e0aa3a0a4..d121e1b2bf5c501f6c9216c7af8bd60cccb9a66a 100644 (file)
@@ -569,7 +569,11 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf,
     *err = NULL;
     if (conn->worker->s->io_buffer_size_set) {
         iobuf_size = conn->worker->s->io_buffer_size;
-        iobuf = apr_palloc(r->pool, iobuf_size);
+        /* Allocate a buffer if the configured size is larger than the
+         * stack buffer, otherwise use the stack buffer. */
+        if (iobuf_size > AP_IOBUFSIZE) {
+            iobuf = apr_palloc(r->pool, iobuf_size);
+        }
     }
 
     pfd.desc_type = APR_POLL_SOCKET;