Skip to content

Fix bug #81163 indirect vars in __sleep #7169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

krakjoe
Copy link
Member

@krakjoe krakjoe commented Jun 18, 2021

No description provided.

@krakjoe krakjoe added the Bug label Jun 18, 2021
@krakjoe krakjoe force-pushed the bug81163 branch 3 times, most recently from d601160 to 393624e Compare June 18, 2021 07:55
@@ -980,7 +980,13 @@ static void php_var_serialize_nested_data(smart_str *buf, zval *struc, HashTable
static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash) /* {{{ */
{
HashTable props;
if (php_var_serialize_get_sleep_props(&props, struc, HASH_OF(retval_ptr)) == SUCCESS) {

if (Z_TYPE_P(retval_ptr) != IS_ARRAY) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should be in php_var_serialize_call_sleep, replacing the HASH_OF check there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, of course.

Also, we want to do the other kind of fix (correctly) in branches below master, right ?

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be nice to switch php_var_serialize_call_sleep to return HashTable* to avoid implicit zval type contract.

@krakjoe
Copy link
Member Author

krakjoe commented Jun 18, 2021

May be nice to switch php_var_serialize_call_sleep to return HashTable* to avoid implicit zval type contract.

In 696d9d6

Quick sanity check ?

@krakjoe
Copy link
Member Author

krakjoe commented Jun 18, 2021

Merged as fba4391

Thanks

@krakjoe krakjoe closed this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants