Skip to content
Permalink
Browse files

* modules/generators/mod_cgi.c (cgi_handler): Fix possible segfaults

in CGI bucket methods if invoked from a subrequest.

PR: 31247


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105250 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
notroj committed Sep 22, 2004
1 parent 07b2af2 commit bbeb0516cf06e118c27aa5953983c8171ba2777b
Showing with 4 additions and 1 deletion.
  1. +4 −1 modules/generators/mod_cgi.c
@@ -905,7 +905,10 @@ static int cgi_handler(request_rec *r)
apr_file_pipe_timeout_set(script_in, 0);
apr_file_pipe_timeout_set(script_err, 0);

b = cgi_bucket_create(r, script_in, script_err, c->bucket_alloc);
/* if r is a subrequest, ensure that the bucket only references
* r->main, since it may last longer than the subreq. */
b = cgi_bucket_create(r->main ? r->main : r, script_in, script_err,
c->bucket_alloc);
#else
b = apr_bucket_pipe_create(script_in, c->bucket_alloc);
#endif

0 comments on commit bbeb051

Please sign in to comment.
You can’t perform that action at this time.