]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #24198 (Invalid recursion detection in array_merge_recurcive())
authorIlia Alshanetsky <iliaa@php.net>
Mon, 16 Jun 2003 17:37:15 +0000 (17:37 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 16 Jun 2003 17:37:15 +0000 (17:37 +0000)
ext/standard/array.c

index 64c0ad84a2117fe1c03d3f35658df812be8af76a..597daf25083c39582ca8b15b1c9b3e4fb5b6f0e4 100644 (file)
@@ -2001,7 +2001,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS
                                if (recursive &&
                                        zend_hash_find(dest, string_key, string_key_len,
                                                                   (void **)&dest_entry) == SUCCESS) {
-                                       if (*src_entry == *dest_entry) {
+                                       if (*src_entry == *dest_entry && ((*dest_entry)->refcount % 2)) {
                                                zend_error(E_WARNING, "%s(): recursion detected",
                                                                   get_active_function_name(TSRMLS_C));
                                                return 0;