From: Ilia Alshanetsky Date: Wed, 10 May 2006 13:07:56 +0000 (+0000) Subject: MFB: Fixed bug #37394 (substr_compare() returns an error when offset equals X-Git-Tag: BEFORE_NEW_OUTPUT_API~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dd87b5307fe5259f5a8e9f449008488cf935bb9;p=php MFB: Fixed bug #37394 (substr_compare() returns an error when offset equals string length). --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 475081ff41..ea52fcb51a 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -6824,7 +6824,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; }