summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-17 15:58:29 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-17 15:58:29 +0200
commitb864abfe23fde5d79a303519674ba83062f89361 (patch)
tree28b5541853c9df1801431a20ba22d5007ad63175 /ext/standard
parentbd0514913b7f803858b062919af22ac16fe5cacc (diff)
downloadphp-git-b864abfe23fde5d79a303519674ba83062f89361.tar.gz
Fixed bug #69100
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/tests/file/bug69100.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug69100.phpt b/ext/standard/tests/file/bug69100.phpt
new file mode 100644
index 0000000000..b243bfc3a0
--- /dev/null
+++ b/ext/standard/tests/file/bug69100.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #69100: Bus error from stream_copy_to_stream (file -> SSL stream) with invalid length
+--FILE--
+<?php
+
+$fileIn = __DIR__ . '/bug69100_in.txt';
+$fileOut = __DIR__ . '/bug69100_out.txt';
+
+file_put_contents($fileIn, str_repeat('A', 64 * 1024));
+$fr = fopen($fileIn, 'rb');
+$fw = fopen($fileOut, 'w');
+
+var_dump(stream_copy_to_stream($fr, $fw, 32 * 1024));
+var_dump(stream_copy_to_stream($fr, $fw, 64 * 1024));
+
+fclose($fr);
+fclose($fw);
+unlink($fileIn);
+unlink($fileOut);
+
+?>
+--EXPECT--
+int(32768)
+int(32768)