We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 252bc44 commit 99c9cc2Copy full SHA for 99c9cc2
tests/basic/bug80384.phpt
@@ -0,0 +1,26 @@
1
+--TEST--
2
+Bug #80384 large reads cause filters to internally buffer large amounts of memory
3
+
4
+--FILE--
5
+<?php
6
+/* First, create a file to read */
7
+$tmp_filename = __DIR__ . "/bug80384.tmp";
8
+$fp = fopen($tmp_filename, 'w');
9
+for ($i=0; $i<1024; $i++) {
10
+ fwrite($fp, str_repeat('ABCDEFGH', 1024));
11
+}
12
+fclose($fp);
13
14
+/* Stream the file through a filter */
15
+$fp = fopen($tmp_filename, 'r');
16
+$filter = stream_filter_append($fp, "string.rot13");
17
+fread($fp, 8 * 1024 * 1024);
18
19
+echo (memory_get_usage() < 1024 * 1024);
20
21
22
+?>
23
+--CLEAN--
24
25
+--EXPECT--
26
+1
0 commit comments