php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66182 exit in stream filter produces segfault
Submitted: 2013-11-26 23:51 UTC Modified: -
From: igor at wiedler dot ch Assigned:
Status: Closed Package: Streams related
PHP Version: 5.5.6 OS:
Private report: No CVE-ID: None
 [2013-11-26 23:51 UTC] igor at wiedler dot ch
Description:
------------
An exit statement inside the implementation of a custom stream filter results in a segmentation fault.

I don't have gdb on this machine, so cannot provide a stack trace. But it's quite easy to reproduce.

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

class before_body_foo_filter extends php_user_filter
{
    function filter($in, $out, &$consumed, $closing)
    {
        // this exit; causes a segfault
        exit;
    }
}

stream_filter_register('before_body_foo', 'before_body_foo_filter');

$fp = fopen('php://output', 'w');
stream_filter_append($fp, 'before_body_foo', STREAM_FILTER_WRITE, 'YES');
fwrite($fp, 'hello');



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-03 07:10 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ab5c593f77b229210a88d436270707f74b22b78
Log: Fix bug #66182 	exit in stream filter produces segfault
 [2014-04-03 07:10 UTC] mike@php.net
-Status: Open +Status: Closed
 [2014-04-03 08:02 UTC] ab@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ab5c593f77b229210a88d436270707f74b22b78
Log: Fix bug #66182 	exit in stream filter produces segfault
 [2014-04-03 08:04 UTC] ab@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ab5c593f77b229210a88d436270707f74b22b78
Log: Fix bug #66182 	exit in stream filter produces segfault
 [2014-04-10 04:47 UTC] tyrael@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ab5c593f77b229210a88d436270707f74b22b78
Log: Fix bug #66182 	exit in stream filter produces segfault
 [2014-10-07 23:15 UTC] stas@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=7ab5c593f77b229210a88d436270707f74b22b78
Log: Fix bug #66182 	exit in stream filter produces segfault
 [2014-10-07 23:26 UTC] stas@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=7ab5c593f77b229210a88d436270707f74b22b78
Log: Fix bug #66182 	exit in stream filter produces segfault
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC