tony2001 Wed Jun 6 21:55:18 2007 UTC Modified files: /php-src/ext/standard string.c Log: improve the check http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.641&r2=1.642&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.641 php-src/ext/standard/string.c:1.642 --- php-src/ext/standard/string.c:1.641 Wed Jun 6 20:06:43 2007 +++ php-src/ext/standard/string.c Wed Jun 6 21:55:18 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.641 2007/06/06 20:06:43 stas Exp $ */ +/* $Id: string.c,v 1.642 2007/06/06 21:55:18 tony2001 Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2919,7 +2919,7 @@ 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 @@ 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 @@ 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;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php