mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.0'
* PHP-8.0: Fix #81294: Segfault when removing a filter
This commit is contained in:
commit
ccb6642c91
2 changed files with 23 additions and 1 deletions
22
ext/standard/tests/filters/bug81294.phpt
Normal file
22
ext/standard/tests/filters/bug81294.phpt
Normal file
|
@ -0,0 +1,22 @@
|
|||
--TEST--
|
||||
Bug #81294 (Segfault when removing a filter)
|
||||
--EXTENSIONS--
|
||||
zlib
|
||||
--FILE--
|
||||
<?php
|
||||
$f = fopen(__DIR__ . "/bug81294.txt", "wb+");
|
||||
$flt1 = stream_filter_append($f, "zlib.deflate", STREAM_FILTER_WRITE);
|
||||
$flt2 = stream_filter_append($f, "string.rot13", STREAM_FILTER_WRITE);
|
||||
fwrite($f, "test");
|
||||
stream_filter_remove($flt1);
|
||||
fwrite($f, "test");
|
||||
stream_filter_remove($flt2);
|
||||
rewind($f);
|
||||
var_dump(urlencode(fread($f, 1024)));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/bug81294.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
string(16) "%2BV-.%01%00grfg"
|
|
@ -416,7 +416,7 @@ PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish)
|
|||
for(current = filter; current; current = current->next) {
|
||||
php_stream_filter_status_t status;
|
||||
|
||||
status = filter->fops->filter(stream, current, inp, outp, NULL, flags);
|
||||
status = current->fops->filter(stream, current, inp, outp, NULL, flags);
|
||||
if (status == PSFS_FEED_ME) {
|
||||
/* We've flushed the data far enough */
|
||||
return SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue