Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15846 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41848 invoked by uid 1010); 6 Apr 2005 07:16:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 41826 invoked from network); 6 Apr 2005 07:16:41 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 6 Apr 2005 07:16:41 -0000 X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([82.94.239.5:54443] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id BA/1F-19272-9DC83524 for ; Wed, 06 Apr 2005 03:16:41 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j367Hgqe003911 for ; Wed, 6 Apr 2005 09:17:42 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j367HcAI003899; Wed, 6 Apr 2005 09:17:38 +0200 Date: Wed, 6 Apr 2005 09:16:34 +0200 (CEST) X-X-Sender: derick@localhost To: Kamesh Jayachandran cc: internals@lists.php.net In-Reply-To: <1112771633.21209.231222484@webmail.messagingengine.com> Message-ID: References: <1112771633.21209.231222484@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jci-ict.nl Subject: Re: [PHP-DEV] refcount and hence double free issue From: derick@php.net (Derick Rethans) On Wed, 6 Apr 2005, Kamesh Jayachandran wrote: > Hi All, > I have come across a double free because of improper refcount > manipulation. > 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