@@ -1640,7 +1640,7 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
1640
1640
memset (Z_STRVAL_P (str ) + old_len , ' ' , offset - old_len );
1641
1641
memcpy (Z_STRVAL_P (str ) + offset , string_value , string_len );
1642
1642
if (UNEXPECTED (RETURN_VALUE_USED (opline ))) {
1643
- ZVAL_INTERNED_STR (EX_VAR (opline -> result .var ), zend_string_init (Z_STRVAL_P (str ), Z_STRLEN_P (str ), 0 ));
1643
+ ZVAL_STR (EX_VAR (opline -> result .var ), zend_string_init (Z_STRVAL_P (str ), Z_STRLEN_P (str ), 0 ));
1644
1644
}
1645
1645
return ;
1646
1646
} else if (!Z_REFCOUNTED_P (str )) {
@@ -1656,7 +1656,7 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
1656
1656
int k = 0 ;
1657
1657
// Source offset
1658
1658
int i = 0 ;
1659
- char * buffer = emalloc (Z_STRLEN_P (str ) + string_len - 1 ); // -1 as we replace a byte
1659
+ char * buffer = emalloc (Z_STRLEN_P (str ) + string_len );
1660
1660
char * source = Z_STRVAL_P (str );
1661
1661
// Append bytes from the source string to the buffer until the offset is reached
1662
1662
while (i < offset ) {
@@ -1684,7 +1684,7 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
1684
1684
buffer [k ] = '\0' ;
1685
1685
ZVAL_NEW_STR (str , zend_string_init (buffer , Z_STRLEN_P (str ) + string_len - 1 , 0 ));
1686
1686
if (UNEXPECTED (RETURN_VALUE_USED (opline ))) {
1687
- ZVAL_INTERNED_STR (EX_VAR (opline -> result .var ), zend_string_init (Z_STRVAL_P (str ), Z_STRLEN_P (str ), 0 ));
1687
+ ZVAL_STR (EX_VAR (opline -> result .var ), zend_string_init (Z_STRVAL_P (str ), Z_STRLEN_P (str ), 0 ));
1688
1688
}
1689
1689
1690
1690
efree (buffer );
0 commit comments