]> granicus.if.org Git - php/commitdiff
Fixed NULL pointer def in ext/standard/tests/array/array_fill_keys_variation2.php
authorXinchen Hui <laruence@gmail.com>
Wed, 5 Mar 2014 09:31:10 +0000 (17:31 +0800)
committerXinchen Hui <laruence@gmail.com>
Wed, 5 Mar 2014 09:31:10 +0000 (17:31 +0800)
ext/standard/array.c

index 40371d231046576a5ba8007bc74ffdf45d1a3624..cad4cc8d8e61ad2fcffb65b7af8b9b10d0b18c38 100644 (file)
@@ -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);