stas            Wed Mar  7 18:15:46 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       string.c 
  Log:
  fix MOPB#14
  # The error message seems wrong, so maybe better fix is needed
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.45&r2=1.445.2.14.2.46&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.45 
php-src/ext/standard/string.c:1.445.2.14.2.46
--- php-src/ext/standard/string.c:1.445.2.14.2.45       Sat Mar  3 15:46:29 2007
+++ php-src/ext/standard/string.c       Wed Mar  7 18:15:46 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.45 2007/03/03 15:46:29 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.46 2007/03/07 18:15:46 stas Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -5074,7 +5074,7 @@
                offset = (offset < 0) ? 0 : offset;
        }
 
-       if ((offset + len) > s1_len) {
+       if ((offset + len) > s1_len || (offset+len) < 0) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position 
cannot exceed initial string length");
                RETURN_FALSE;
        }

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

Reply via email to