Skip to content

Commit aa86530

Browse files
committed
* 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
1 parent c8a9d21 commit aa86530

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/proxy/mod_proxy_fcgi.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,11 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf,
569569
*err = NULL;
570570
if (conn->worker->s->io_buffer_size_set) {
571571
iobuf_size = conn->worker->s->io_buffer_size;
572-
iobuf = apr_palloc(r->pool, iobuf_size);
572+
/* Allocate a buffer if the configured size is larger than the
573+
* stack buffer, otherwise use the stack buffer. */
574+
if (iobuf_size > AP_IOBUFSIZE) {
575+
iobuf = apr_palloc(r->pool, iobuf_size);
576+
}
573577
}
574578

575579
pfd.desc_type = APR_POLL_SOCKET;

0 commit comments

Comments
 (0)