From: Ilia Alshanetsky Date: Thu, 18 Aug 2005 01:15:23 +0000 (+0000) Subject: MFH: Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2). X-Git-Tag: php-5.0.5RC1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06c10055d589716e7b994856657c8dee2177c916;p=php MFH: Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2). --- diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index ad4e93bd49..b1f56e431b 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -506,6 +506,7 @@ zend_first_try { ctx = SG(server_context); if (ctx == NULL) { +normal: ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); /* register a cleanup so we clear out the SG(server_context) * after each request. Note: We pass in the pointer to the @@ -522,6 +523,11 @@ zend_first_try { } } else { parent_req = ctx->r; + /* check if comming due to ErrorDocument */ + if (parent_req != HTTP_OK) { + parent_req = NULL; + goto normal; + } ctx->r = r; brigade = ctx->brigade; }