From 91bd50d1b0037be7bc779dd64b38a790ba06fdef Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 10 May 2006 13:07:15 +0000 Subject: [PATCH] Fixed bug #37394 (substr_compare() returns an error when offset equals string length). --- NEWS | 2 ++ ext/standard/string.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 752f267e1d..32204b579f 100644 --- 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) diff --git a/ext/standard/string.c b/ext/standard/string.c index c923e84ab0..da735dad00 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -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; } -- 2.40.0