]> granicus.if.org Git - php/commitdiff
Fixed bug #37394 (substr_compare() returns an error when offset equals
authorIlia Alshanetsky <iliaa@php.net>
Wed, 10 May 2006 13:07:15 +0000 (13:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 10 May 2006 13:07:15 +0000 (13:07 +0000)
string length).

NEWS
ext/standard/string.c

diff --git a/NEWS b/NEWS
index 752f267e1da9d8cc4bb3aea68ec669b5c5a56e71..32204b579f1422904e1a9e66b60081e271989369 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ PHP                                                                        NEWS
 - Added support for Apache 2.2 handler in the Windows distro. (Edin)
 - Added pg_field_table() function. (Edin)
 - Add implementation of curl_multi_info_read (Brian)
+- Fixed bug #37394 (substr_compare() returns an error when offset equals 
+  string length). (Ilia)
 - Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of 
   request). (Tony)
 - Fixed bug #37376 (fastcgi.c compile fail with gcc 2.95.4). (Ilia)
index c923e84ab006bf40b779d34e1df074a1ab82dd75..da735dad00cde35566e02123210a4817909b8ee1 100644 (file)
@@ -4894,7 +4894,7 @@ PHP_FUNCTION(substr_compare)
                offset = (offset < 0) ? 0 : offset;
        }
 
-       if ((offset + len) >= 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;
        }