]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 18 Aug 2005 01:15:23 +0000 (01:15 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 18 Aug 2005 01:15:23 +0000 (01:15 +0000)
sapi/apache2handler/sapi_apache2.c

index ad4e93bd490463e81b59b8205127b4ebda24e6bd..b1f56e431b5490ac9154a50a737c2899c85c2ee5 100644 (file)
@@ -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;
        }