felipe Wed Mar 19 03:05:35 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/serialize bug43614.phpt
Modified files: /php-src/ext/standard var_unserializer.c var_unserializer.re /php-src/ext/standard/tests/array array_push_error2.phpt Log: MFB: Fixed bug #43614 (incorrect processing of numerical string keys of array in arbitrary serialized data) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.70.2.4.2.7.2.3&r2=1.70.2.4.2.7.2.4&diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.3 php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.4 --- php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.3 Wed Oct 17 10:36:33 2007 +++ php-src/ext/standard/var_unserializer.c Wed Mar 19 03:05:34 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.c,v 1.70.2.4.2.7.2.3 2007/10/17 10:36:33 dmitry Exp $ */ +/* $Id: var_unserializer.c,v 1.70.2.4.2.7.2.4 2008/03/19 03:05:34 felipe Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -290,10 +290,10 @@ zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); break; case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { var_push_dtor(var_hash, old_data); } - zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); + zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.52.2.2.2.6.2.3&r2=1.52.2.2.2.6.2.4&diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.52.2.2.2.6.2.3 php-src/ext/standard/var_unserializer.re:1.52.2.2.2.6.2.4 --- php-src/ext/standard/var_unserializer.re:1.52.2.2.2.6.2.3 Wed Oct 17 10:36:33 2007 +++ php-src/ext/standard/var_unserializer.re Wed Mar 19 03:05:34 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.re,v 1.52.2.2.2.6.2.3 2007/10/17 10:36:33 dmitry Exp $ */ +/* $Id: var_unserializer.re,v 1.52.2.2.2.6.2.4 2008/03/19 03:05:34 felipe Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -294,10 +294,10 @@ zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); break; case IS_STRING: - if (zend_hash_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { var_push_dtor(var_hash, old_data); } - zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); + zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_push_error2.phpt?r1=1.1.4.3&r2=1.1.4.4&diff_format=u Index: php-src/ext/standard/tests/array/array_push_error2.phpt diff -u php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.3 php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.4 --- php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.3 Thu Feb 14 16:29:45 2008 +++ php-src/ext/standard/tests/array/array_push_error2.phpt Wed Mar 19 03:05:34 2008 @@ -1,5 +1,9 @@ --TEST-- Test array_push() function : error conditions - min and max int values as keys +--SKIPIF-- +<?php +if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); +?> --FILE-- <?php /* Prototype : int array_push(array $stack, mixed $var [, mixed $...]) @@ -28,22 +32,22 @@ *** Testing array_push() : error conditions *** int(3) array(3) { - [-%d]=> + [-2147483647]=> string(3) "min" - [%d]=> + [2147483647]=> string(3) "max" - [-%d]=> + [-2147483648]=> string(3) "new" } Warning: array_push(): Cannot add element to the array as the next element is already occupied in %s on line %d bool(false) array(3) { - [-%d]=> + [-2147483647]=> string(3) "min" - [%d]=> + [2147483647]=> string(3) "max" - [-%d]=> + [-2147483648]=> string(3) "new" } -Done \ No newline at end of file +Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/bug43614.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/serialize/bug43614.phpt +++ php-src/ext/standard/tests/serialize/bug43614.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php