Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/generators/cgi_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,20 +312,22 @@ static apr_status_t cgi_read_stdout(apr_bucket *a, apr_file_t *out,
{
char *buf;
apr_status_t rv;
struct cgi_bucket_data *data = a->data;

*str = NULL;
*len = APR_BUCKET_BUFF_SIZE;
buf = apr_bucket_alloc(*len, a->list); /* XXX: check for failure? */

rv = apr_file_read(out, buf, len);

if (rv != APR_SUCCESS && rv != APR_EOF) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, data->r, APLOGNO(10599)
"failed reading stdout from script %s",
data->r->filename);
apr_bucket_free(buf);
return rv;
}

if (*len > 0) {
struct cgi_bucket_data *data = a->data;
apr_bucket_heap *h;

/* Change the current bucket to refer to what we read */
Expand Down