tony2001                Wed Jun  6 21:53:54 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       string.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.62&r2=1.445.2.14.2.63&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.62 
php-src/ext/standard/string.c:1.445.2.14.2.63
--- php-src/ext/standard/string.c:1.445.2.14.2.62       Wed Jun  6 18:15:41 2007
+++ php-src/ext/standard/string.c       Wed Jun  6 21:53:54 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.62 2007/06/06 18:15:41 stas Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.63 2007/06/06 21:53:54 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1860,12 +1860,11 @@
                        e = haystack + haystack_len - 1;
                } else {
                        p = haystack;
-                       if (-offset > haystack_len || -offset < 0) {
+                       if (-offset > haystack_len || offset < -INT_MAX) {
                                php_error_docref(NULL TSRMLS_CC, E_NOTICE, 
"Offset is greater than the length of haystack string");
                                RETURN_FALSE;
-                       } else {
-                               e = haystack + haystack_len + offset;
                        }
+                       e = haystack + haystack_len + offset;
                }
                /* Borrow that ord_needle buffer to avoid repeatedly 
tolower()ing needle */
                *ord_needle = tolower(*needle);
@@ -1893,7 +1892,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(needle_dup);
                        efree(haystack_dup);
                        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is 
greater than the length of haystack string");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to