]> 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:53 +0000 (01:15 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 18 Aug 2005 01:15:53 +0000 (01:15 +0000)
NEWS
sapi/apache2handler/sapi_apache2.c

diff --git a/NEWS b/NEWS
index 1d8ccda05c7dfc794c01e071f180275bdd8311ff..c4fec4d8ebb2843c7139571d43f245686e316d89 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ PHP 4                                                                      NEWS
 - Fixed bug #34064 (arr[] as param to function is allowed only if function 
   receives argument by reference). (Dmitry)
 - Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP). (Dmitry)
+- Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2).
+  (Ilia)
 - Fixed bug #33940 (array_map() fails to pass by reference when called
   recursively). (Dmitry)
 - Fixed bug #33690 (Crash setting some ini directives in httpd.conf). (Rasmus)
index 809abdf46be7ae6450987272e73e9967ab15ae52..6fd3dae561acdb0f4510e4c1ce2c3e6d8da4fd4a 100644 (file)
@@ -527,6 +527,7 @@ static int php_handler(request_rec *r)
 zend_first_try {
 
        if (ctx == NULL) {
+normal:
                brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc);
                ctx = SG(server_context);
                ctx->brigade = brigade;
@@ -536,6 +537,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;
        }