diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
| commit | 993e1866df547532a05ab6db76c9ff5aefc9a3df (patch) | |
| tree | 169d3bde0974235d3cde164786ef6f381a4749a7 /ext/zlib/tests/bug_40189.phpt | |
| parent | 1f589a2bd44ba835ad1b009a5d83abd453724829 (diff) | |
| download | php-upstream/5.2.6.tar.gz | |
Imported Upstream version 5.2.6upstream/5.2.6
Diffstat (limited to 'ext/zlib/tests/bug_40189.phpt')
| -rw-r--r-- | ext/zlib/tests/bug_40189.phpt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/zlib/tests/bug_40189.phpt b/ext/zlib/tests/bug_40189.phpt new file mode 100644 index 000000000..07e5191a9 --- /dev/null +++ b/ext/zlib/tests/bug_40189.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #40189 (endless loop in zlib.inflate stream filter) +--SKIPIF-- +<?php if (!extension_loaded("zlib")) print "skip"; ?> +--FILE-- +<?php +// this string is an excerpt of a phar archive that caused an infinite loop +$a = "\x3\x0\x85\x46\x2f\x7c\xc2\xaa\x69\x2b\x6d\xe5\xdb\xfe\xe4\x21\x8f\x0\x97\x21\x1d\x2\x0\x0\x0\x47\x42\x4d\x42"; +var_dump(base64_encode($a)); +$gp = fopen(dirname(__FILE__) . '/test.other', 'wb'); +$fp = fopen('data://text/plain;base64,AwCFRi98wqppK23l2/7kIY8AlyEdAgAAAEdCTUI=', 'r'); +stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ); +var_dump(stream_copy_to_stream($fp, $gp, 5)); +fclose($fp); +fclose($gp); +var_dump(file_get_contents(dirname(__FILE__) . '/test.other')); +?> +--CLEAN-- +<?php +@unlink(dirname(__FILE__) . '/test.other'); +?> +--EXPECT-- +string(40) "AwCFRi98wqppK23l2/7kIY8AlyEdAgAAAEdCTUI=" +int(0) +string(0) "" |
