Skip to content

Commit 560c32c

Browse files
committed
Fix GH-17509: Apache parent and subrequest double bailout
1 parent e48ceb0 commit 560c32c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sapi/apache2handler/sapi_apache2.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ static int php_handler(request_rec *r)
592592
apr_bucket *bucket;
593593
apr_status_t rv;
594594
request_rec * volatile parent_req = NULL;
595+
JMP_BUF *parent_bailout = NULL;
595596
#ifdef ZTS
596597
/* initial resource fetch */
597598
(void)ts_resource(0);
@@ -665,6 +666,10 @@ static int php_handler(request_rec *r)
665666
ap_add_cgi_vars(r);
666667
}
667668

669+
if (parent_bailout == NULL && parent_req && EG(bailout)) {
670+
parent_bailout = EG(bailout);
671+
}
672+
668673
zend_first_try {
669674

670675
if (ctx == NULL) {
@@ -749,6 +754,10 @@ zend_first_try {
749754
ctx->r = parent_req;
750755
}
751756

757+
if (parent_bailout) {
758+
EG(bailout) = parent_bailout;
759+
}
760+
752761
return OK;
753762
}
754763

0 commit comments

Comments
 (0)