php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72684 AppendIterator segfault with closed generator
Submitted: 2016-07-27 00:32 UTC Modified: -
From: pierrick@php.net Assigned:
Status: Closed Package: SPL related
PHP Version: 5.6.24 OS:
Private report: No CVE-ID: None
 [2016-07-27 00:32 UTC] pierrick@php.net
Description:
------------
AppendIterator segfault when trying to iterate on a closed Generator

Test script:
---------------
<?php

function createGenerator() { yield 1; }
$generator = createGenerator();

$appendIterator = new AppendIterator();
$appendIterator->append($generator);

iterator_to_array($appendIterator);
try {
    iterator_to_array($appendIterator);
} catch (\Exception $e) {
    echo $e->getMessage();
}


Expected result:
----------------
Cannot traverse an already closed generator


Actual result:
--------------
Segmentation fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-27 00:39 UTC] pierrick@php.net
Automatic comment on behalf of pierrick
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4c2e1a13be27b0c44ac5c33a6c548a3d5e5faf8c
Log: Fixed bug #72684 (AppendIterator segfault with closed generator)
 [2016-07-27 00:39 UTC] pierrick@php.net
-Status: Open +Status: Closed
 [2016-10-17 10:10 UTC] bwoebi@php.net
Automatic comment on behalf of pierrick
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4c2e1a13be27b0c44ac5c33a6c548a3d5e5faf8c
Log: Fixed bug #72684 (AppendIterator segfault with closed generator)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 15:01:32 2024 UTC