1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00

Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix signed integer overflow
This commit is contained in:
Nikita Popov
2020-10-30 12:39:47 +01:00
+1 -1
View File
@@ -1553,7 +1553,7 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
if ((size_t)offset >= Z_STRLEN_P(str)) {
/* Extend string if needed */
zend_long old_len = Z_STRLEN_P(str);
ZVAL_NEW_STR(str, zend_string_extend(Z_STR_P(str), offset + 1, 0));
ZVAL_NEW_STR(str, zend_string_extend(Z_STR_P(str), (size_t)offset + 1, 0));
memset(Z_STRVAL_P(str) + old_len, ' ', offset - old_len);
Z_STRVAL_P(str)[offset+1] = 0;
} else if (!Z_REFCOUNTED_P(str)) {