File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / zlib / tests / bug_52944.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:11 2013 UTC (11 years, 3 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #52944 (segfault with zlib filter and corrupted data)
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
	die("skip not for windows");
}
if (PHP_OS == 'Darwin') {
	die("skip not for Darwin");
}
--INI--
allow_url_fopen=1
--FILE--
<?php
require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";

$fp = fopen('data://text/plain;base64,' . $data, 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
var_dump(fread($fp,1));
var_dump(fread($fp,1));
fclose($fp);
echo "Done.\n";
--EXPECT--
string(0) ""
string(0) ""
Done.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>