mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Correct check for maximum string length in JIT helpers
This commit is contained in:
commit
b6e55d9856
1 changed files with 3 additions and 3 deletions
|
@ -1718,7 +1718,7 @@ static void ZEND_FASTCALL zend_jit_fast_assign_concat_helper(zval *op1, zval *op
|
||||||
zend_string *result_str;
|
zend_string *result_str;
|
||||||
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(Z_STR_P(op1), Z_STR_P(op2));
|
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(Z_STR_P(op1), Z_STR_P(op2));
|
||||||
|
|
||||||
if (UNEXPECTED(op1_len > SIZE_MAX - op2_len)) {
|
if (UNEXPECTED(op1_len > ZSTR_MAX_LEN - op2_len)) {
|
||||||
zend_throw_error(NULL, "String size overflow");
|
zend_throw_error(NULL, "String size overflow");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1754,7 +1754,7 @@ static void ZEND_FASTCALL zend_jit_fast_concat_helper(zval *result, zval *op1, z
|
||||||
zend_string *result_str;
|
zend_string *result_str;
|
||||||
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(Z_STR_P(op1), Z_STR_P(op2));
|
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(Z_STR_P(op1), Z_STR_P(op2));
|
||||||
|
|
||||||
if (UNEXPECTED(op1_len > SIZE_MAX - op2_len)) {
|
if (UNEXPECTED(op1_len > ZSTR_MAX_LEN - op2_len)) {
|
||||||
zend_throw_error(NULL, "String size overflow");
|
zend_throw_error(NULL, "String size overflow");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1778,7 +1778,7 @@ static void ZEND_FASTCALL zend_jit_fast_concat_tmp_helper(zval *result, zval *op
|
||||||
zend_string *result_str;
|
zend_string *result_str;
|
||||||
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(Z_STR_P(op1), Z_STR_P(op2));
|
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(Z_STR_P(op1), Z_STR_P(op2));
|
||||||
|
|
||||||
if (UNEXPECTED(op1_len > SIZE_MAX - op2_len)) {
|
if (UNEXPECTED(op1_len > ZSTR_MAX_LEN - op2_len)) {
|
||||||
zend_throw_error(NULL, "String size overflow");
|
zend_throw_error(NULL, "String size overflow");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue