mirror of
https://github.com/php/php-src.git
synced 2024-11-26 03:16:33 +08:00
Fixed incorrect usage of zend_mangle_property_name() (valgrind errors)
This commit is contained in:
parent
55cdb7c043
commit
415ec46927
@ -584,18 +584,18 @@ static void php_var_serialize_class(smart_str *buf, zval **struc, zval *retval_p
|
||||
|
||||
do {
|
||||
zend_mangle_property_name(&priv_name, &prop_name_length, ce->name, ce->name_length,
|
||||
Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, ce->type & ZEND_INTERNAL_CLASS);
|
||||
if (zend_hash_find(Z_OBJPROP_PP(struc), priv_name, prop_name_length, (void *) &d) == SUCCESS) {
|
||||
php_var_serialize_string(buf, priv_name, prop_name_length-1);
|
||||
Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
|
||||
if (zend_hash_find(Z_OBJPROP_PP(struc), priv_name, prop_name_length+1, (void *) &d) == SUCCESS) {
|
||||
php_var_serialize_string(buf, priv_name, prop_name_length);
|
||||
efree(priv_name);
|
||||
php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
|
||||
break;
|
||||
}
|
||||
efree(priv_name);
|
||||
zend_mangle_property_name(&prot_name, &prop_name_length, "*", 1,
|
||||
Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, ce->type & ZEND_INTERNAL_CLASS);
|
||||
if (zend_hash_find(Z_OBJPROP_PP(struc), prot_name, prop_name_length, (void *) &d) == SUCCESS) {
|
||||
php_var_serialize_string(buf, prot_name, prop_name_length - 1);
|
||||
Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
|
||||
if (zend_hash_find(Z_OBJPROP_PP(struc), prot_name, prop_name_length+1, (void *) &d) == SUCCESS) {
|
||||
php_var_serialize_string(buf, prot_name, prop_name_length);
|
||||
efree(prot_name);
|
||||
php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user