dmitry          Mon Jul 11 12:25:47 2005 EDT

  Modified files:              (Branch: PHP_4_4)
    /php-src    NEWS 
    /php-src/ext/standard       array.c 
  Log:
  Fixed bug #31158 (array_splice on $GLOBALS crashes)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.13&r2=1.1247.2.920.2.14&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.13 php-src/NEWS:1.1247.2.920.2.14
--- php-src/NEWS:1.1247.2.920.2.13      Mon Jul 11 03:45:08 2005
+++ php-src/NEWS        Mon Jul 11 12:25:44 2005
@@ -1,5 +1,8 @@
 PHP 4                                                                      NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+?? ??? 2005, Version 4.4.1
+- Fixed bug #31158 (array_splice on $GLOBALS crashes). (Dmitry)
+
 11 Jul 2005, Version 4.4.0
 - Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana)
 - Added support for .cc files in extensions. (Brian)
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.199.2.44.2.2&r2=1.199.2.44.2.3&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.199.2.44.2.2 
php-src/ext/standard/array.c:1.199.2.44.2.3
--- php-src/ext/standard/array.c:1.199.2.44.2.2 Tue Jun 21 08:11:19 2005
+++ php-src/ext/standard/array.c        Mon Jul 11 12:25:46 2005
@@ -22,7 +22,7 @@
 */
 
 
-/* $Id: array.c,v 1.199.2.44.2.2 2005/06/21 12:11:19 dmitry Exp $ */
+/* $Id: array.c,v 1.199.2.44.2.3 2005/07/11 16:25:46 dmitry Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -1831,8 +1831,8 @@
           hashtable and replace it with new one */
        new_hash = php_splice(Z_ARRVAL_P(stack), 0, 0, &args[1], argc-1, NULL);
        zend_hash_destroy(Z_ARRVAL_P(stack));
-       efree(Z_ARRVAL_P(stack));
-       Z_ARRVAL_P(stack) = new_hash;
+       *Z_ARRVAL_P(stack) = *new_hash;
+       FREE_HASHTABLE(new_hash);
 
        /* Clean up and return the number of elements in the stack */
        efree(args);
@@ -1909,8 +1909,8 @@
        
        /* Replace input array's hashtable with the new one */
        zend_hash_destroy(Z_ARRVAL_P(array));
-       efree(Z_ARRVAL_P(array));
-       Z_ARRVAL_P(array) = new_hash;
+       *Z_ARRVAL_P(array) = *new_hash;
+       FREE_HASHTABLE(new_hash);
        
        /* Clean up */
        if (argc == 4)
@@ -2397,8 +2397,8 @@
        
        /* Copy the result hash into return value */
        zend_hash_destroy(Z_ARRVAL_P(return_value));
-       efree(Z_ARRVAL_P(return_value));
-       Z_ARRVAL_P(return_value) = new_hash;
+       *Z_ARRVAL_P(return_value) = *new_hash;
+       FREE_HASHTABLE(new_hash);
        
        /* Clean up */
        efree(pads);

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

Reply via email to