|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-06 09:03 UTC] sqchen at citiz dot net
[2006-01-06 12:51 UTC] tony2001@php.net
[2006-01-06 14:40 UTC] sniper@php.net
[2006-01-10 17:14 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
Description: ------------ stream_socket_append() twice will cause segfault, the same as stream_socket_prepend() Reproduce code: --------------- <?php class strtoupper_filter extends php_user_filter{ function filter($in, $out, &$consumed, $closing) { while($bucket=stream_bucket_make_writeable($in)){ $bucket->data = strtoupper($bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); /*here twice will cause segfault*/ stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } function onCreate(){ echo "fffffffffff\n"; } function onClose(){ echo "hello\n"; } } stream_filter_register("strtoupper", "strtoupper_filter"); $fp=fopen("1.txt", "w"); stream_filter_append($fp, "strtoupper"); fread($fp, 1024); fwrite($fp, "Thank you\n"); fclose($fp); readfile("1.txt"); unlink("1.txt"); ?> Actual result: -------------- segfault