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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pierrick@php.net
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Mar 19 02:01:28 2024 UTC