Bug #66182 [Opn->Csd]: exit in stream filter produces segfault
| From: | mike@php.net | Date: | Thu, 03 Apr 2014 07:10:15 +0000 |
| Subject: | Bug #66182 [Opn->Csd]: exit in stream filter produces segfault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185054@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66182&edit=1
ID: 66182
Updated by: mike@php.net
Reported by: igor at wiedler dot ch
Summary: exit in stream filter produces segfault
-Status: Open
+Status: Closed
Type: Bug
Package: Streams related
PHP Version: 5.5.6
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2013-11-26 23:51:09] 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');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66182&edit=1