mirror of
https://github.com/php/php-src.git
synced 2026-04-02 05:32:28 +02:00
MFH
This commit is contained in:
@@ -205,9 +205,15 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
|
||||
|
||||
switch (Z_TYPE_P(key)) {
|
||||
case IS_LONG:
|
||||
if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) {
|
||||
var_replace(var_hash, old_data, rval);
|
||||
}
|
||||
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)) {
|
||||
var_replace(var_hash, old_data, rval);
|
||||
}
|
||||
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL);
|
||||
break;
|
||||
}
|
||||
@@ -947,6 +953,8 @@ yy86:
|
||||
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (*rval == *rval_ref) return 0;
|
||||
|
||||
if (*rval != NULL) {
|
||||
zval_ptr_dtor(rval);
|
||||
|
||||
@@ -208,9 +208,15 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int
|
||||
|
||||
switch (Z_TYPE_P(key)) {
|
||||
case IS_LONG:
|
||||
if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)) {
|
||||
var_replace(var_hash, old_data, rval);
|
||||
}
|
||||
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)) {
|
||||
var_replace(var_hash, old_data, rval);
|
||||
}
|
||||
zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL);
|
||||
break;
|
||||
}
|
||||
@@ -320,6 +326,8 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
||||
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (*rval == *rval_ref) return 0;
|
||||
|
||||
if (*rval != NULL) {
|
||||
zval_ptr_dtor(rval);
|
||||
|
||||
Reference in New Issue
Block a user