php-src/Zend/tests/string_offset_int_min_max.phpt
Nikita Popov 527ad1d80c Avoid signed integer overflow in string offset check
Cast to size_t before performing operations instead of afterwards.
2019-12-19 11:47:50 +01:00

17 lines
308 B
PHP

--TEST--
Accessing PHP_INT_MAX and PHP_INT_MIN as string offsets
--FILE--
<?php
$str = "";
var_dump($str[PHP_INT_MAX]);
var_dump($str[PHP_INT_MIN]);
?>
--EXPECTF--
Notice: Uninitialized string offset: %d in %s on line %d
string(0) ""
Notice: Uninitialized string offset: -%d in %s on line %d
string(0) ""