summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-09-16 09:28:49 +0200
committerAnatol Belski <ab@php.net>2014-09-16 09:33:02 +0200
commit71cc3991bffbd70ca92e1d92d67565c4fb94eb55 (patch)
tree50219f94c8e42f13ac381ee0d7a802f4fbf231eb
parent6d2ca4b50892f318f46cf0f0084a4abc132708b2 (diff)
downloadphp-git-71cc3991bffbd70ca92e1d92d67565c4fb94eb55.tar.gz
cast the other way round, the sign check is already done before
-rw-r--r--Zend/zend_execute.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 679d551a31..0c8e7379d7 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -760,7 +760,7 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu
}
old_str = Z_STR_P(str);
- if (offset >= (zend_long)Z_STRLEN_P(str)) {
+ if ((size_t)offset >= Z_STRLEN_P(str)) {
zend_long old_len = Z_STRLEN_P(str);
Z_STR_P(str) = zend_string_realloc(Z_STR_P(str), offset + 1, 0);
Z_TYPE_INFO_P(str) = IS_STRING_EX;
@@ -1215,7 +1215,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
offset = Z_LVAL_P(dim);
}
- if (UNEXPECTED(offset < 0) || UNEXPECTED((zend_long)Z_STRLEN_P(container) <= offset)) {
+ if (UNEXPECTED(offset < 0) || UNEXPECTED(Z_STRLEN_P(container) <= (size_t)offset)) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Uninitialized string offset: %pd", offset);
}