php-src/ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt
2007-09-19 00:18:01 +00:00

15 lines
420 B
PHP
Executable File

--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)