tony2001                Wed Oct 12 17:24:15 2005 EDT

  Modified files:              (Branch: PHP_5_1)
    /php-src    NEWS 
    /php-src/sapi/apache2handler        sapi_apache2.c 
  Log:
  fix bug #34581 (crash with mod_rewrite)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.121&r2=1.2027.2.122&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.121 php-src/NEWS:1.2027.2.122
--- php-src/NEWS:1.2027.2.121   Wed Oct 12 11:03:03 2005
+++ php-src/NEWS        Wed Oct 12 17:23:48 2005
@@ -79,6 +79,7 @@
 - Fixed bug #34590 (User defined PDOStatement class can't implement methods).
   (Marcus)
 - Fixed bug #34584 (Segfault with SPL autoload handler). (Marcus)
+- Fixed bug #34581 (crash with mod_rewrite). (Tony, Ilia)
 - Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters).
   (Marco, Ilia)
 - Fixed bug #34557 (php -m exits with "error" 1). (Johannes)
http://cvs.php.net/diff.php/php-src/sapi/apache2handler/sapi_apache2.c?r1=1.57.2.3&r2=1.57.2.4&ty=u
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.57.2.3 
php-src/sapi/apache2handler/sapi_apache2.c:1.57.2.4
--- php-src/sapi/apache2handler/sapi_apache2.c:1.57.2.3 Tue Oct  4 20:43:38 2005
+++ php-src/sapi/apache2handler/sapi_apache2.c  Wed Oct 12 17:24:09 2005
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sapi_apache2.c,v 1.57.2.3 2005/10/05 00:43:38 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.57.2.4 2005/10/12 21:24:09 tony2001 Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -473,6 +473,7 @@
                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_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;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to