From: Antony Dovgal Date: Wed, 6 Jun 2007 21:55:18 +0000 (+0000) Subject: improve the check X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~503 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a67784d228c5042c602c7f61b9be7250336e4b3;p=php improve the check --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 155bbf6c69..fd9e85c4e9 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2919,7 +2919,7 @@ PHP_FUNCTION(strripos) u_e = haystack.u + haystack_len - needle_len; } else { u_p = haystack.u; - if (-offset > haystack_len || -offset < 0) { + if (-offset > haystack_len || offset < -INT_MAX) { RETURN_FALSE; } else { cu_offset = haystack_len; @@ -2957,7 +2957,7 @@ PHP_FUNCTION(strripos) e = haystack.s + haystack_len - 1; } else { p = haystack.s; - if (-offset > haystack_len || -offset < 0) { + if (-offset > haystack_len || offset < INT_MAX) { RETURN_FALSE; } else { e = haystack.s + haystack_len + offset; @@ -2988,7 +2988,7 @@ PHP_FUNCTION(strripos) p = haystack_dup + offset; e = haystack_dup + haystack_len - needle_len; } else { - if (-offset > haystack_len || -offset < 0) { + if (-offset > haystack_len || offset < -INT_MAX) { efree(haystack_dup); efree(needle_dup); RETURN_FALSE;