Bug #81163 [Opn->Csd]: indirect in __sleep

From: Date: Fri, 18 Jun 2021 09:23:52 +0000
Subject: Bug #81163 [Opn->Csd]: indirect in __sleep
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234478@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81163&edit=1

 ID:                 81163
 Updated by:         git@php.net
 Reported by:        krakjoe@php.net
 Summary:            indirect in __sleep
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Reproducible crash
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of krakjoe
Revision: https://github.com/php/php-src/commit/fba439196e032195a3a7e612717df4241522054c
Log: Fix bug #81163 __sleep allowed to return non-array


Previous Comments:
------------------------------------------------------------------------
[2021-06-18 05:14:30] krakjoe@php.net

The following pull request has been associated:

Patch Name: Fix bug #81163 indirect vars in __sleep
On GitHub:  https://github.com/php/php-src/pull/7169
Patch:      https://github.com/php/php-src/pull/7169.patch

------------------------------------------------------------------------
[2021-06-18 05:10:52] krakjoe@php.net

Description:
------------
indirect vars returned in properties for __sleep not handled correctly

Test script:
---------------
<?php
class foo
{
    private $private = 'private';
}

class bar extends foo
{
    public function __sleep()
    {
        return (new bar());
    }
}

var_dump(serialize(new bar()));
?>

Expected result:
----------------
Warning: serialize(): "private" returned as member variable from __sleep() but does not
exist in /opt/src/php-src/sec.php on line 15
string(14) "O:3:"bar":0:{}"


Actual result:
--------------
assert fail


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81163&edit=1


Thread (3 messages)

« previous php.bugs (#234478) next »