xref: /PHP-7.2/ext/spl/tests/bug67247.phpt (revision 84605098)
1--TEST--
2Bug #67247 (spl_fixedarray_resize integer overflow)
3--FILE--
4<?php
5$ar = new SplFixedArray(1);
6echo "size: ".$ar->getSize()."\n";
7$ar->setSize((PHP_INT_SIZE==8)?0x2000000000000001:0x40000001);
8echo "size: ".$ar->getSize()."\n";
9?>
10--EXPECTF--
11size: 1
12
13Fatal error: Possible integer overflow in memory allocation (%d * %d + 0) in %s on line %d
14