com php-src: cast the other way round, the sign check is already done before: Zend/zend_execute.c

From: Date: Tue, 16 Sep 2014 07:33:02 +0000
Subject: com php-src: cast the other way round, the sign check is already done before: Zend/zend_execute.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81673@lists.php.net to get a copy of this message
Commit: 71cc3991bffbd70ca92e1d92d67565c4fb94eb55 Author: Anatol Belski <ab@php.net> Tue, 16 Sep 2014 09:28:49 +0200 Parents: 6d2ca4b50892f318f46cf0f0084a4abc132708b2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=71cc3991bffbd70ca92e1d92d67565c4fb94eb55 Log: cast the other way round, the sign check is already done before Changed paths: M Zend/zend_execute.c Diff: diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 679d551..0c8e737 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); }

« previous php.cvs (#81673) next »