PHP :: Bug #27997 :: SPL: Crash with getInnerIterator()
| Bug #27997 | SPL: Crash with getInnerIterator() | ||||
|---|---|---|---|---|---|
| Submitted: | 2004-04-14 16:28 UTC | Modified: | 2004-04-14 19:26 UTC | ||
| From: | adam at trachtenberg dot com | Assigned: | helly (profile) | ||
| Status: | Closed | Package: | Reproducible crash | ||
| PHP Version: | 5CVS-2004-04-14 (dev) | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2004-04-14 16:28 UTC] adam at trachtenberg dot com
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.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-04-14 17:11 UTC] amt@php.net
[2004-04-14 19:26 UTC] helly@php.net