Annotation of embedaddon/php/ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: iconv_substr() charset parameter length checks (CVE-2007-4783)
3: --SKIPIF--
4: <?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
5: --FILE--
6: <?php
7: $a = str_repeat('A', 99897);
8: $b = str_repeat('/', 2798349);
9: var_dump(iconv_substr($a, 0, 1, $b));
10: ?>
11: --EXPECTF--
12:
13: Warning: iconv_substr(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d
14: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>