Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21030 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70434 invoked by uid 1010); 4 Dec 2005 09:52:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 70419 invoked from network); 4 Dec 2005 09:52:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2005 09:52:49 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:32364] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id D1/17-14828-F6CB2934 for ; Sun, 04 Dec 2005 04:52:48 -0500 Received: (qmail 3925 invoked from network); 4 Dec 2005 09:52:43 -0000 Received: from shire.zend.office (10.1.2.160) by internal.zend.office with SMTP; 4 Dec 2005 09:52:43 -0000 Date: Sun, 4 Dec 2005 11:52:43 +0200 (IST) X-X-Sender: frodo@shire.zend.office To: PHP Development Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: SPL memory allocation problem From: stas@zend.com (Stanislav Malyshev) In spl_iterators.c around line 320 (function spl_recursive_it_rewind_ex), there's the following code: erealloc(object->iterators, sizeof(spl_sub_iterator)); As we see, object->iterators is not assigned the result of realloc. As I can see, this may lead to a problem when erealloc returns different location then it was before. For me it happens when iterator is repeatedly applied to same object (i.e., multiple passes for same object, rewinding between them). So I think it needs to be fixed - I just wated to ask whoever is responsible for the code before I commit the fix if there was any idea behind not assigning erealloc result or it's just an omission. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115