From 7dd87b5307fe5259f5a8e9f449008488cf935bb9 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 10 May 2006 13:07:56 +0000 Subject: [PATCH] MFB: Fixed bug #37394 (substr_compare() returns an error when offset equals string length). --- ext/standard/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.50.1