andrey                                   Fri, 25 Sep 2009 11:38:19 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288749

Log:
Fix a crash in the rare case when a persistent connection
is found dead, after CHNG_USER. mysql->mysql will be NULL
and segfault will follow.

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c
    U   php/php-src/trunk/ext/mysqli/mysqli_nonapi.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c     2009-09-25 
11:10:55 UTC (rev 288748)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_nonapi.c     2009-09-25 
11:38:19 UTC (rev 288749)
@@ -217,7 +217,7 @@
                                                                
MyG(num_active_persistent) + MyG(num_inactive_persistent));
                goto err;
        }
-       if (!is_real_connect && !mysql->mysql) {
+       if (!mysql->mysql) {
 #if !defined(MYSQLI_USE_MYSQLND)
                if (!(mysql->mysql = mysql_init(NULL))) {
 #else

Modified: php/php-src/trunk/ext/mysqli/mysqli_nonapi.c
===================================================================
--- php/php-src/trunk/ext/mysqli/mysqli_nonapi.c        2009-09-25 11:10:55 UTC 
(rev 288748)
+++ php/php-src/trunk/ext/mysqli/mysqli_nonapi.c        2009-09-25 11:38:19 UTC 
(rev 288749)
@@ -216,7 +216,7 @@
                                                                
MyG(num_active_persistent) + MyG(num_inactive_persistent));
                goto err;
        }
-       if (!is_real_connect && !mysql->mysql) {
+       if (!mysql->mysql) {
 #if !defined(MYSQLI_USE_MYSQLND)
                if (!(mysql->mysql = mysql_init(NULL))) {
 #else

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

Reply via email to