From: Antony Dovgal Date: Wed, 12 Oct 2005 21:31:49 +0000 (+0000) Subject: MF51: fix bug #34581 (crash with mod_rewrite) X-Git-Tag: RELEASE_0_9_1~130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34d511ab9d0f6075823063a9f42b7733d8721226;p=php MF51: fix bug #34581 (crash with mod_rewrite) --- diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 88e48cc37b..06b7bd912c 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -473,6 +473,7 @@ normal: ctx->r = r; ctx = NULL; /* May look weird to null it here, but it is to catch the right case in the first_try later on */ } else { + parent_req = ctx->r; ctx->r = r; } apply_config(conf); @@ -531,7 +532,15 @@ zend_first_try { zend_bailout(); } } else { - parent_req = ctx->r; + if (!parent_req) { + parent_req = ctx->r; + } + if (parent_req && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) { + if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { + zend_bailout(); + } + } + /* check if comming due to ErrorDocument */ if (parent_req && parent_req->status != HTTP_OK) { parent_req = NULL;