Annotation of embedaddon/php/ext/iconv/tests/iconv_set_encoding-charset-length-cve-2007-4840.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: iconv_set_encoding() charset parameter length checks (CVE-2007-4840)
        !             3: --SKIPIF--
        !             4: <?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
        !             5: --FILE--
        !             6: <?php
        !             7: $a = str_repeat("/", 9000000);
        !             8: var_dump(iconv_set_encoding("input_encoding", $a));
        !             9: var_dump(iconv_set_encoding("output_encoding", $a));
        !            10: var_dump(iconv_set_encoding("internal_encoding", $a));
        !            11: ?>
        !            12: --EXPECTF--
        !            13: 
        !            14: Warning: iconv_set_encoding(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d
        !            15: bool(false)
        !            16: 
        !            17: Warning: iconv_set_encoding(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d
        !            18: bool(false)
        !            19: 
        !            20: Warning: iconv_set_encoding(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d
        !            21: bool(false)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>