|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-14 17:11 UTC] amt@php.net
[2004-04-14 19:26 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 11:00:01 2025 UTC |
Description: ------------ SPL crashes PHP when the developer misuses getInnerIterator(). This test case triggers the crash, but it probably not the smallest such test case. Sorry. Reproduce code: --------------- class CrashIterator extends FilterIterator implements RecursiveIterator { function accept() { return true; } function hasChildren() { return $this->getInnerIterator()->hasChildren(); } function getChildren() { return new RecursiveDirectoryIterator($this->getInnerIterator()->getPath()); } } $dir = new RecursiveIteratorIterator(new CrashIterator( new RecursiveDirectoryIterator($argv[1])), 1); foreach ($dir as $file) { print "$file\n"; } Expected result: ---------------- No crash. Actual result: -------------- Core dump. Let me know if you want a bt.