summaryrefslogtreecommitdiff
path: root/ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt
blob: c27e60d1dd02b788a827518b79b4c6586886ef54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--TEST--
iconv_substr() charset parameter length checks (CVE-2007-4783)
--SKIPIF--
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
--FILE--
<?php
$a = str_repeat('A', 99897);
$b = str_repeat('/', 2798349);
var_dump(iconv_substr($a, 0, 1, $b));
?>
--EXPECTF--

Warning: iconv_substr(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d
bool(false)