com php-src: redo the fix casting to size_t where applica ble: ext/mbstring/mbstring.c ext/mbstring/php_mbregex .c

From: Date: Tue, 16 Sep 2014 19:17:19 +0000
Subject: com php-src: redo the fix casting to size_t where applica ble: ext/mbstring/mbstring.c ext/mbstring/php_mbregex .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81693@lists.php.net to get a copy of this message
Commit: 49a6b485a0173b855e31ce8dc7800ac1672b6981 Author: Anatol Belski <ab@php.net> Tue, 16 Sep 2014 12:48:15 +0200 Parents: db24742f01497208bfcef105a90f58eb595938de Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=49a6b485a0173b855e31ce8dc7800ac1672b6981 Log: redo the fix casting to size_t where applicable Changed paths: M ext/mbstring/mbstring.c M ext/mbstring/php_mbregex.c Diff: diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index b2bceed..615381e 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2963,7 +2963,7 @@ PHP_FUNCTION(mb_strimwidth) string.val = (unsigned char *)str; string.len = str_len; - if (from < 0 || from > (zend_long)str_len) { + if (from < 0 || (size_t)from > str_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start position is out of range"); RETURN_FALSE; } diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index d78131f..864d50a 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1403,7 +1403,7 @@ PHP_FUNCTION(mb_ereg_search_setpos) return; } - if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && position >= (zend_long)Z_STRLEN(MBREX(search_str)))) { + if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range"); MBREX(search_pos) = 0; RETURN_FALSE;

« previous php.cvs (#81693) next »