xref: /PHP-5.3/ext/zlib/tests/bug_52944.phpt (revision 3ad033ff)
1--TEST--
2Bug #52944 (segfault with zlib filter and corrupted data)
3--SKIPIF--
4<?php if (!extension_loaded("zlib")) print "skip"; ?>
5<?php
6if (substr(PHP_OS, 0, 3) == 'WIN') {
7	die("skip not for windows");
8}
9if (PHP_OS == 'Darwin') {
10	die("skip not for Darwin");
11}
12--INI--
13allow_url_fopen=1
14--FILE--
15<?php
16require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
17
18$fp = fopen('data://text/plain;base64,' . $data, 'r');
19stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
20var_dump(fread($fp,1));
21var_dump(fread($fp,1));
22fclose($fp);
23echo "Done.\n";
24--EXPECT--
25string(0) ""
26string(0) ""
27Done.
28