mirror of
https://github.com/php/php-src.git
synced 2025-01-24 04:33:39 +08:00
Fix string offset signed int UB in jit as well
This commit is contained in:
parent
ed372541da
commit
2bc0a6e97f
@ -610,7 +610,7 @@ try_string_offset:
|
||||
offset = Z_LVAL_P(dim);
|
||||
}
|
||||
|
||||
if (UNEXPECTED(Z_STRLEN_P(container) < (size_t)((offset < 0) ? -offset : (offset + 1)))) {
|
||||
if (UNEXPECTED(Z_STRLEN_P(container) < ((offset < 0) ? -(size_t)offset : ((size_t)offset + 1)))) {
|
||||
zend_error(E_WARNING, "Uninitialized string offset: " ZEND_LONG_FMT, offset);
|
||||
ZVAL_EMPTY_STRING(result);
|
||||
} else {
|
||||
@ -658,7 +658,7 @@ try_string_offset:
|
||||
offset = Z_LVAL_P(dim);
|
||||
}
|
||||
|
||||
if (UNEXPECTED(Z_STRLEN_P(container) < (size_t)((offset < 0) ? -offset : (offset + 1)))) {
|
||||
if (UNEXPECTED(Z_STRLEN_P(container) < ((offset < 0) ? -(size_t)offset : ((size_t)offset + 1)))) {
|
||||
ZVAL_NULL(result);
|
||||
} else {
|
||||
zend_uchar c;
|
||||
|
Loading…
Reference in New Issue
Block a user