com php-src: Fixed NULL pointer def in ext/standard/tests/array /array_fill_keys_variation2.php: ext/standard/arr ay.c
| From: | Dmitry Stogov | Date: | Wed, 05 Mar 2014 09:31:10 +0000 |
| Subject: | com php-src: Fixed NULL pointer def in ext/standard/tests/array /array_fill_keys_variation2.php: ext/standard/arr ay.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77752@lists.php.net to get a copy of this message | ||
Commit: 75d567ef9a2a02e11bb64a73f928caaa52ca153c
Author: Xinchen Hui <laruence@gmail.com> Wed, 5 Mar 2014 17:31:10 +0800
Parents: 36f01f158cdcd9b2740388e0675b69652e2c9e6c
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=75d567ef9a2a02e11bb64a73f928caaa52ca153c
Log:
Fixed NULL pointer def in ext/standard/tests/array/array_fill_keys_variation2.php
Changed paths:
M ext/standard/array.c
Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 40371d2..cad4cc8 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1525,6 +1525,10 @@ PHP_FUNCTION(array_fill_keys)
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &pos);
while ((entry = zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), &pos)) != NULL) {
+ if (UNEXPECTED(Z_ISREF_P(entry))) {
+ entry = Z_REFVAL_P(entry);
+ }
+
if (Z_TYPE_P(entry) == IS_LONG) {
zval_add_ref(val);
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_P(entry), val);