mirror of
https://github.com/php/php-src.git
synced 2026-04-20 14:31:06 +02:00
Adding two `zend_long`s may overflow, and casting `size_t` to `zend_long` may truncate; we can avoid this here by enforcing unsigned arithmetic. Closes GH-7240.
12 lines
189 B
PHP
12 lines
189 B
PHP
--TEST--
|
|
Bug #72146 (Integer overflow on substr_replace)
|
|
--FILE--
|
|
<?php
|
|
var_dump(substr_replace(["ABCDE"], "123", 3, PHP_INT_MAX));
|
|
?>
|
|
--EXPECT--
|
|
array(1) {
|
|
[0]=>
|
|
string(6) "ABC123"
|
|
}
|