#27997 [NEW]: SPL: Crash with getInnerIterator()

From: Date: Wed, 14 Apr 2004 20:28:02 +0000
Subject: #27997 [NEW]: SPL: Crash with getInnerIterator()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58138@lists.php.net to get a copy of this message
From: adam at trachtenberg dot com Operating system: * PHP version: 5CVS-2004-04-14 (dev) PHP Bug Type: Reproducible crash Bug description: SPL: Crash with getInnerIterator() 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. -- Edit bug report at http://bugs.php.net/?id=27997&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27997&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27997&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27997&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27997&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27997&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27997&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27997&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27997&r=support Expected behavior: http://bugs.php.net/fix.php?id=27997&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27997&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27997&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27997&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27997&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27997&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27997&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27997&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27997&r=float

« previous php.bugs (#58138) next »