iliaa           Tue Mar 14 14:55:27 2006 UTC

  Modified files:              
    /php-src/ext/standard       string.c 
  Log:
  MFB51: Fixed offset/length parameter validation in substr_compare() function.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/string.c?r1=1.526&r2=1.527&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.526 php-src/ext/standard/string.c:1.527
--- php-src/ext/standard/string.c:1.526 Mon Mar 13 14:37:32 2006
+++ php-src/ext/standard/string.c       Tue Mar 14 14:55:27 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.526 2006/03/13 14:37:32 iliaa Exp $ */
+/* $Id: string.c,v 1.527 2006/03/14 14:55:27 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -6492,7 +6492,7 @@
                offset = s1_len + offset;
        }
 
-       if (len && offset >= s1_len) {
+       if (offset + len >= s1_len) {
                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