From c4b82fe1d5cac8d87cdb5ae54771964485f3ff3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9opold=20Jacquot?= Date: Wed, 4 Dec 2019 15:14:50 +0100 Subject: [PATCH] Add unit test for bug #78902 --- ext/standard/tests/streams/bug78902.phpt | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ext/standard/tests/streams/bug78902.phpt diff --git a/ext/standard/tests/streams/bug78902.phpt b/ext/standard/tests/streams/bug78902.phpt new file mode 100644 index 0000000000000..319d04e195443 --- /dev/null +++ b/ext/standard/tests/streams/bug78902.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #78902: Memory leak when using stream_filter_append +--FILE-- + 0) { + fputs($fp, str_pad('', min($chunk,$size))); + $size -= $chunk; +} +fclose($fp); + +$fp = fopen($tmp_file_name, 'r'); +stream_filter_append($fp, "string.toupper"); +while (!feof($fp)) { + fread($fp, 1); +} +fclose($fp); +var_dump(true); +?> +--XFAIL-- +This bug was introduce in PHP 7.3.11 an is still open +--EXPECT-- +bool(true)