Re: refcount and hence double free issue
| From: | Kamesh Jayachandran | Date: | Wed, 06 Apr 2005 07:18:35 +0000 |
| Subject: | Re: refcount and hence double free issue | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15847@lists.php.net to get a copy of this message | ||
It happens in php-5.0.4 also.
With regards
Kamesh Jayachandran
On Wed, 6 Apr 2005 09:16:34 +0200 (CEST), "Derick Rethans"
<derick@php.net> said:
> On Wed, 6 Apr 2005, Kamesh Jayachandran wrote:
>
> > Hi All,
> > I have come across a double free because of improper refcount
> > manipulation.
> > <?php
> > class MyTextSanitizer
> > {
> > var $smileys=array()
> > function MyTextSanitizer() {}
> > function getSmileys()
> > {
> > return $this->smileys;
> > }
> > }
> > $myts = new MyTextSanitizer();
> > $smiles =& $myts->getSmileys(); //calling by ref alone causes improper
> > refcount
> > $smiles = $myts->getSmileys(); //this does not cause improper refcount
> > ?>
>
> This fact is known, Marcus and I have a working patch for this - but
> it'll break binairy compat for PHP 4.4 - stay tuned for this.
>
> regards,
> Derick
>
> --
> Derick Rethans
> http://derickrethans.nl |
> http://ez.no | http://xdebug.org