From: Joe Orton Date: Wed, 8 May 2024 12:44:52 +0000 (+0000) Subject: * modules/proxy/mod_proxy_fcgi.c (dispatch): Only allocate a heap X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa86530aec72e5de24227dbe2054cd713fb3d3f5;p=thirdparty%2Fapache%2Fhttpd.git * modules/proxy/mod_proxy_fcgi.c (dispatch): Only allocate a heap 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 --- diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index d420df6a77a..d121e1b2bf5 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -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;