summaryrefslogtreecommitdiff
path: root/ext/iconv/tests/iconv-charset-length-cve-2007-4840.phpt
blob: 03b3574d6e4a01437c945d99e31b78bf0c0ff474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
iconv() charset parameter length checks (CVE-2007-4840)
--SKIPIF--
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
--FILE--
<?php
$a = str_repeat("/", 9000000);
var_dump(iconv($a, "b", "test"));
var_dump(iconv("x", $a, "test"));
?>
--EXPECTF--

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

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