xref: /PHP-7.1/ext/zlib/tests/bug_52944.phpt (revision 7af945e2)
1--TEST--
2Bug #52944 (segfault with zlib filter and corrupted data)
3--SKIPIF--
4<?php if (!extension_loaded("zlib")) print "skip"; ?>
5--INI--
6allow_url_fopen=1
7--FILE--
8<?php
9/* NOTE this test can fail on asm builds of zlib 1.2.5 or
10   1.2.7 on at least Windows and Darwin. Using unoptimized
11   zlib build fixes the issue. */
12
13require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
14
15$fp = fopen('data://text/plain;base64,' . $data, 'r');
16stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
17var_dump(fread($fp,1));
18var_dump(fread($fp,1));
19fclose($fp);
20echo "Done.\n";
21--EXPECT--
22string(0) ""
23string(0) ""
24Done.
25