]> granicus.if.org Git - php/commitdiff
Test for bug #72221, segfault in zend_memnstr_ex
authorLauri Kenttä <lauri.kentta@gmail.com>
Tue, 24 May 2016 14:33:44 +0000 (17:33 +0300)
committerXinchen Hui <laruence@gmail.com>
Sat, 28 May 2016 08:10:29 +0000 (16:10 +0800)
Zend/tests/bug72221.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug72221.phpt b/Zend/tests/bug72221.phpt
new file mode 100644 (file)
index 0000000..8f30099
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+Bug #72221 (Segmentation fault in stream_get_line / zend_memnstr_ex)
+--FILE--
+<?php
+$fp = fopen("php://memory", "r+");
+fwrite($fp, str_repeat("baad", 1024*1024));
+rewind($fp);
+stream_get_line($fp, 1024*1024*2, "aaaa");
+echo "Done\n";
+--EXPECT--
+Done